# Makie rotate colorbar label

**URL:** https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263
**Category:** Visualization
**Tags:** makie
**Created:** [April 9, 2022, 3:17pm UTC](https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263 "2022-04-09T15:17:17Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![jewh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jewh/32/28586_2.png) [@jewh](https://discourse.julialang.org/u/jewh)
#### Post date: [April 9, 2022, 3:17pm UTC](https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263/1 "2022-04-09T15:17:17Z")

</div>

How do I rotate the label on the colorbar in Makie?

MWE:

```julia
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

```

 ![test](https://global.discourse-cdn.com/julialang/original/3X/1/a/1a65c04411892ef99b5f9481683f1149f76f0bb7.png)

How can I rotate the colorbar label π/2 clockwise?

---

<div class="post-metadata">

### Author: ![jewh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jewh/32/28586_2.png) [@jewh](https://discourse.julialang.org/u/jewh)
#### Post date: [April 9, 2022, 3:18pm UTC](https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263/2 "2022-04-09T15:18:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [April 9, 2022, 5:32pm UTC](https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263/3 "2022-04-09T17:32:43Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![jewh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jewh/32/28586_2.png) [@jewh](https://discourse.julialang.org/u/jewh)
#### Post date: [April 9, 2022, 5:47pm UTC](https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263/4 "2022-04-09T17:47:54Z")

</div>

Thanks, will have a look at that

---

<div class="post-metadata">

### Author: ![jewh](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jewh/32/28586_2.png) [@jewh](https://discourse.julialang.org/u/jewh)
#### Post date: [April 10, 2022, 11:49am UTC](https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263/5 "2022-04-10T11:49:35Z")

</div>

Not sure if I’m doing it right, but I can’t see the entry

```julia
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}}}}

```

---

<div class="post-metadata">

### Author: ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)
#### Post date: [April 10, 2022, 12:44pm UTC](https://discourse.julialang.org/t/makie-rotate-colorbar-label/79263/6 "2022-04-10T12:44:41Z")

</div>

Ah then it’s in axis and that one’s elements
