# Makie.jl: align first axis' boundary with ticklabels of second axis

**URL:** <https://discourse.julialang.org/t/makie-jl-align-first-axis-boundary-with-ticklabels-of-second-axis/70626>\
**Category:** Visualization\
**Tags:** plotting, plots, makie\
**Created:** [October 29, 2021, 3:29pm UTC](https://discourse.julialang.org/t/makie-jl-align-first-axis-boundary-with-ticklabels-of-second-axis/70626 "2021-10-29T15:29:03Z")\
**Posts on this page:** 3\
**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:** [October 29, 2021, 3:29pm UTC](https://discourse.julialang.org/t/makie-jl-align-first-axis-boundary-with-ticklabels-of-second-axis/70626/1 "2021-10-29T15:29:03Z")

</div>

I have the figure  
 ![Examples](https://global.discourse-cdn.com/julialang/original/3X/0/3/0346a5a3e2b85997ea6ca060ac8c2f08a52d0f59.png)  
in which I want to make best use of the available space, i.e., let subfigure (a) reach the right boundary.  
Makie allocates space to xticklabels on the right hand side of the figures; here from the colorbar.  
How do I tell Makie to do this 😃

A MWE would be

```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)
rowgap!(fig.layout, 4)
colgap!(fig.layout, 4)
	
fig

```

---

<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:** [October 29, 2021, 3:46pm UTC](https://discourse.julialang.org/t/makie-jl-align-first-axis-boundary-with-ticklabels-of-second-axis/70626/2 "2021-10-29T15:46:33Z")

</div>

Adding `alignmode = Outside()` to the colorbar did exactly this.

---

<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:** [October 29, 2021, 9:24pm UTC](https://discourse.julialang.org/t/makie-jl-align-first-axis-boundary-with-ticklabels-of-second-axis/70626/3 "2021-10-29T21:24:11Z")

</div>

Or more targeted `Mixed(right = 0)`, I do the same with the colorbar in the layout tutorial here [Layout Tutorial](https://makie.juliaplots.org/stable/tutorials/layout-tutorial/#mixed_alignmode)
