Skip to content

Commit

Permalink
return axs
Browse files Browse the repository at this point in the history
  • Loading branch information
kongdd committed Apr 9, 2024
1 parent dd2c543 commit d34227b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Layers/imagesc.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ function imagesc!(fig::Union{Figure,GridPosition,GridSubposition},
titles === nothing && (titles = fill("", n))
k = 0
ax, plt = nothing, nothing
axs = []
for i = 1:nrow, j = 1:ncol
k += 1
k > n && break
Expand All @@ -97,14 +98,15 @@ function imagesc!(fig::Union{Figure,GridPosition,GridSubposition},
ax, plt = imagesc!(fig[i, j], x, y, _z;
title, colorrange, force_show_legend, colors, kw...)
(fun_axis!) !== nothing && fun_axis!(ax)
push!(axs, ax)
end

# unify the legend
(colorrange != automatic && !force_show_legend) && Colorbar(fig[:, ncol+1], plt)

rowgap!(fig.layout, gap)
colgap!(fig.layout, gap)
fig
axs
end

function imagesc!(fig, z; kw...)
Expand Down

0 comments on commit d34227b

Please sign in to comment.