# Y-axis in CairoMakie.jl not vertical

**URL:** <https://discourse.julialang.org/t/y-axis-in-cairomakie-jl-not-vertical/93165>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [January 18, 2023, 3:23pm UTC](https://discourse.julialang.org/t/y-axis-in-cairomakie-jl-not-vertical/93165 "2023-01-18T15:23:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mgp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgp/32/28599_2.png) [@mgp](https://discourse.julialang.org/u/mgp)\
**Post date:** [January 18, 2023, 3:23pm UTC](https://discourse.julialang.org/t/y-axis-in-cairomakie-jl-not-vertical/93165/1 "2023-01-18T15:23:59Z")

</div>

I am making plots in `CairoMakie.jl` (v0.10.1) and noticed that the y-axis isn’t quite vertical. It generally looks less tidy than the x-axis.

```julia
using CairoMakie
CairoMakie.activate!()

xs = rand(100); ys = rand(100)
fig, axis = scatter(xs, ys)
hidespines!(axis, :t, :r)
axis.xtrimspine = true; axis.ytrimspine = true
hidedecorations!(axis; ticks = false)

save("fig.pdf", fig)

```

It’s most obvious when the figure is exported. The x-axis looks as I’d expect – very tidy but even the bottom of the y-axis is untidy.

![image](https://global.discourse-cdn.com/julialang/original/3X/f/e/feee6f7c9d84a6970eb44f96c6ca15480777393c.png)

The top of the y-axis is even worse

![image](https://global.discourse-cdn.com/julialang/original/3X/e/3/e331f22c29b2bda977d93349754d58ac3245a37f.png)

Is this a known issue? I haven’t found it mentioned elsewhere.

---

<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:** [January 18, 2023, 3:34pm UTC](https://discourse.julialang.org/t/y-axis-in-cairomakie-jl-not-vertical/93165/2 "2023-01-18T15:34:54Z")

</div>

Weird, it could be either the ticks being off or the line not straight, I’d assume that something with the position update of the ticks is not quite right.

---

<div class="post-metadata">

**Author:** ![ffreyer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ffreyer/32/21569_2.png) [@ffreyer](https://discourse.julialang.org/u/ffreyer)\
**Post date:** [January 18, 2023, 4:07pm UTC](https://discourse.julialang.org/t/y-axis-in-cairomakie-jl-not-vertical/93165/3 "2023-01-18T16:07:19Z")

</div>

Seems to be the latter and caused by the `trimspine` changes

---

<div class="post-metadata">

**Author:** ![mgp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgp/32/28599_2.png) [@mgp](https://discourse.julialang.org/u/mgp)\
**Post date:** [February 10, 2023, 10:55am UTC](https://discourse.julialang.org/t/y-axis-in-cairomakie-jl-not-vertical/93165/4 "2023-02-10T10:55:06Z")

</div>

Thank you for your comments. I have added an issue at [y-axis misaligned after axis.ytrimspine · Issue #2664 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/2664).

---

<div class="post-metadata">

**Author:** ![mgp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mgp/32/28599_2.png) [@mgp](https://discourse.julialang.org/u/mgp)\
**Post date:** [February 27, 2024, 3:32pm UTC](https://discourse.julialang.org/t/y-axis-in-cairomakie-jl-not-vertical/93165/5 "2024-02-27T15:32:17Z")

</div>

Just in case anyone comes across this problem, it was fixed in [https://github.com/MakieOrg/Makie.jl/pull/3360](https://github.com/MakieOrg/Makie.jl/pull/3360), which is in Makie version 0.20.0 on (CairoMakie v0.11.0).
