From d70259bca4e0d260bde4461fdfcbd7db7568cc6b Mon Sep 17 00:00:00 2001 From: Patrick Jaap Date: Thu, 7 Nov 2024 14:38:28 +0100 Subject: [PATCH] Fix GLMakie region colorbar in 2D/3D Plots --- src/makie.jl | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/makie.jl b/src/makie.jl index 9b673f1..3513d82 100644 --- a/src/makie.jl +++ b/src/makie.jl @@ -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];