Skip to content

Commit

Permalink
Fix GLMakie region colorbar in 2D/3D Plots
Browse files Browse the repository at this point in the history
  • Loading branch information
pjaap committed Nov 7, 2024
1 parent 3ec4f51 commit d70259b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/makie.jl
Original file line number Diff line number Diff line change
Expand Up @@ -494,16 +494,18 @@ function makescene_grid(ctx)
GL = XMakie.GridLayout(ctx[:figure])
GL[1, 1] = ctx[:scene]
ncol = length(ctx[:cmap])
nbcol = length(ctx[:cmap])
nbcol = length(ctx[:bcmap])
# fontsize=0.5*ctx[:fontsize],ticklabelsize=0.5*ctx[:fontsize]
if ctx[:colorbar] == :vertical
GL[1, 2] = XMakie.Colorbar(ctx[:figure];
colormap = XMakie.cgrad(ctx[:cmap]; categorical = true),
limits = (1, ncol),
limits = (0.5, ncol+0.5),
ticks = 1:ncol,
width = 15,)
GL[1, 3] = XMakie.Colorbar(ctx[:figure];
colormap = XMakie.cgrad(ctx[:bcmap]; categorical = true),
limits = (1, nbcol),
limits = (0.5, nbcol+0.5),
ticks = 1:nbcol,
width = 15,)
elseif ctx[:colorbar] == :horizontal
GL[2, 1] = XMakie.Colorbar(ctx[:figure];
Expand Down

0 comments on commit d70259b

Please sign in to comment.