# 3 yaxes with Makie?

**URL:** https://discourse.julialang.org/t/3-yaxes-with-makie/93032
**Category:** Visualization
**Created:** [January 16, 2023, 3:13pm UTC](https://discourse.julialang.org/t/3-yaxes-with-makie/93032 "2023-01-16T15:13:10Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)
#### Post date: [January 16, 2023, 3:13pm UTC](https://discourse.julialang.org/t/3-yaxes-with-makie/93032/1 "2023-01-16T15:13:10Z")

</div>

Is it possible to make 3 or more y-axes with Makie.jl? You can plot the data but how to move the spines?

```julia
fig=Figure()
ax11 = Axis(fig[1,1], ylabel="Series 1")
lines!(cumsum(randn(1000)))
ax12 = Axis(fig[1,1], yticklabelpad=100, ylabel="Series 2")
lines!(cumsum(randn(1000)) .* 10, color=Cycled(2))
ax13 = Axis(fig[1,1], yticklabelpad=200, ylabel="Series 3")
lines!(cumsum(randn(1000)) .* 100, color=Cycled(3))
fig

```

 ![plot_27](https://global.discourse-cdn.com/julialang/original/3X/c/a/ca20ebd4aaa92e532e11971e923c8c999f003aa3.png)

---

<div class="post-metadata">

### Author: ![ohmsweetohm1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ohmsweetohm1/32/49126_2.png) [@ohmsweetohm1](https://discourse.julialang.org/u/ohmsweetohm1)
#### Post date: [January 16, 2023, 3:42pm UTC](https://discourse.julialang.org/t/3-yaxes-with-makie/93032/2 "2023-01-16T15:42:36Z")

</div>

I came up with this hack

```julia
fig=Figure()
ax11 = Axis(fig[1,3], ylabel="Series 1")
lines!(cumsum(randn(1000)), color=:grey)
ax12 = Axis(fig[1,3], ylabel="Series 2")
lines!(cumsum(randn(1000)) .* 10, color=:dodgerblue)
ax13 = Axis(fig[1,3], ylabel="Series 3")
lines!(cumsum(randn(1000)) .* 100, color=:orange)

linkxaxes!(ax11, ax12, ax13)
hidespines!(ax12, :r, :l, :b, :t)
hidespines!(ax13, :r, :l, :b, :t)

hidespines!(ax12, :r, :l, :b, :t)
hidespines!(ax13, :r, :l, :b, :t)
hidedecorations!(ax12)
hidedecorations!(ax13)

ax12_2 = Axis(fig[1,2], ylabel="Series 2",
    yticklabelcolor = :dodgerblue,
    leftspinecolor = :dodgerblue,
    ytickcolor = :dodgerblue,
    ylabelcolor = :dodgerblue,
)
ax13_2 = Axis(fig[1,1],ylabel="Series 3",
    yticklabelcolor = :orange,
    leftspinecolor = :orange,
    ytickcolor = :orange,
    ylabelcolor = :orange,
)

linkyaxes!(ax12, ax12_2)
hidexdecorations!(ax12_2)
hideydecorations!(ax12_2, label=false, ticklabels=false, ticks=false)
hidespines!(ax12_2, :r, :b, :t)

linkyaxes!(ax13, ax13_2)
hidexdecorations!(ax13_2)
hideydecorations!(ax13_2, label=false, ticklabels=false, ticks=false)
hidespines!(ax13_2, :r, :b, :t)

colsize!(fig.layout, 1, 20)
colsize!(fig.layout, 2, 20)

fig

```

 ![plot_29](https://global.discourse-cdn.com/julialang/original/3X/a/4/a4d780bb22f88f9bb88283249a0578697a4ff685.png)
