Cheers.
Consider the figure:
I aim to align the tick labels of the colorbar on the right.
This happens with ticklabelalign = (:right, :center)
; however then the tick labels lie within the colorbar.
To fix this, I right now manually set ticklabelspace
and ticklabelpad
to values that “look okay”. However, I would much prefer an automatic solution; which will continue to work even when I change parts of the figure.
A MWE is
fig = Figure(resolution = (400, 250), fontsize = 19)
# ------------------------------
# Top Row
axis = Axis(fig[1, 1:4])
lines!(axis, [1:100;], cumsum(randn(100)))
# ------------------------------
# Bottom Row
for i ∈ 1:3
axis = Axis(fig[2, i], ylabel = i == 1 ? "t" : "")
i == 1 || hideydecorations!(axis)
heatmap!(axis, [1:20;], [1:20;], randn(20,20))
end
Colorbar(fig[2,4], size = 10, limits = (-1.0, 1.0),
# ticklabelspace = 2, ticklabelpad = 33, ticklabelalign = (:right, :center),
)
rowgap!(fig.layout, 4)
colgap!(fig.layout, 4)
fig