Hello, is it possible moving the Colorbar from left to right, that is to say switching it with the y axis ? I have nothing found in the docs as to how achieving this.
Do you mean flipaxis
?
1 Like
Or do you mean to do something like this to make a Heatmap for example with the colorbar to the left, and the heatmap y axis ticks moved to the right?
fig = Figure()
ax = Axis(fig[1,1], yaxisposition=:right)
hm = heatmap!(ax, rand(1000,1000))
Colorbar(fig[1,end-1], hm)
fig
1 Like
Actually the solution below from Daniel_Berge is exactly what I need. Never would have thought about that.
The GridLayout
“indexing” doesn’t work like with an array. It’s made for convenience, and one idea is that you can extend the current grid by referencing rows or columns that don’t exist yet. It starts with one row and one column at position 1 by default. But you can add another column at index 0 as shown above (the end-1
). But you can also do Axis(fig[1, 2])
and Colorbar(fig[1, 1])
, that has the same effect.
1 Like