jewh
April 9, 2022, 3:17pm
1
How do I rotate the label on the colorbar in Makie?
MWE:
using CairoMakie
M = rand(10, 10)
fig = CairoMakie.Figure()
ax = Axis(fig[1,1])
cplot = CairoMakie.contourf!(fig[1,1], 1:10, 1:10, M)
Colorbar(fig[1,2], cplot, label="L")
fig
How can I rotate the colorbar label π/2 clockwise?
jewh
April 9, 2022, 3:18pm
2
Aware that I can just have a horizontal colorbar with a correctly oriented label, but I don’t want a horizontal colorbar, I want a vertical colorbar
jules
April 9, 2022, 5:32pm
3
Check colorbar.elements
, that dict should have a label text plot entry. On that object you can set the rotation like on any normal text. It’s not an exposed setting.
1 Like
jewh
April 9, 2022, 5:47pm
4
Thanks, will have a look at that
jewh
April 10, 2022, 11:49am
5
Not sure if I’m doing it right, but I can’t see the entry
julia> Colorbar(fig[1, 2], cplot, label="L").elements
Dict{Symbol, Any} with 6 entries:
:continuous_map => Image{Tuple{StepRangeLen{Float32, Float64, Float64}, StepRangeLen{Float32, Float64, Float64}, Matrix{RGBA{Float32}}}}
:spines => Lines{Tuple{Vector{Point{2, Float32}}}}
:axis => LineAxis(Scene (800px, 600px):…
:categorical_map => Combined{poly, Tuple{Vector{HyperRectangle{2, Float32}}}}
:lowclip => Combined{poly, Tuple{Vector{Point{2, Float32}}}}
:highclip => Combined{poly, Tuple{Vector{Point{2, Float32}}}}
jules
April 10, 2022, 12:44pm
6
Ah then it’s in axis and that one’s elements