# Makie.jl: right align colorbar ticklabel

**URL:** <https://discourse.julialang.org/t/makie-jl-right-align-colorbar-ticklabel/70787>\
**Category:** Visualization\
**Tags:** plotting, makie\
**Created:** [November 2, 2021, 8:35am UTC](https://discourse.julialang.org/t/makie-jl-right-align-colorbar-ticklabel/70787 "2021-11-02T08:35:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Kleinbeck](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevin_kleinbeck/32/21278_2.png) [@Kevin\_Kleinbeck](https://discourse.julialang.org/u/Kevin_Kleinbeck)\
**Post date:** [November 2, 2021, 8:35am UTC](https://discourse.julialang.org/t/makie-jl-right-align-colorbar-ticklabel/70787/1 "2021-11-02T08:35:58Z")

</div>

Cheers.  
Consider the figure:  
 ![Examples](https://global.discourse-cdn.com/julialang/original/3X/0/3/0346a5a3e2b85997ea6ca060ac8c2f08a52d0f59.png)  
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

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

```
