How to stick a colorbar to a scaled axis in Makie

In GridLayoutBase 0.6.2, gridlayouts respect their alignments when they don’t reach the exact size that they should. So the example is now centered by default:

f = Figure(resolution=(1200,300))
Axis(f[1, 1])
Colorbar(f[1, 2])
colsize!(f.layout, 1, Aspect(1, 1))
f

Also, with that rewrite I can soon add a function like gridlayoutsize or something to shrink the figure to the actually required size of the gridlayout, so if I manually add the outer padding just for this example, I get:

resize!(f.scene, gridlayoutsize(f.layout) .+ (32, 32))
f

grafik

1 Like