# Break axis in Makie

**URL:** <https://discourse.julialang.org/t/break-axis-in-makie/62729>\
**Category:** Visualization\
**Tags:** question, makie\
**Created:** [June 11, 2021, 10:56am UTC](https://discourse.julialang.org/t/break-axis-in-makie/62729 "2021-06-11T10:56:23Z")\
**Posts on this page:** 1\
**Showing post:** 10

<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:** [June 15, 2021, 2:22pm UTC](https://discourse.julialang.org/t/break-axis-in-makie/62729/10 "2021-06-15T14:22:56Z")

</div>

Here’s a possible implementation, although it uses some rather internal things:

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/3/d/3dd9fee5d9f01984a78dedf7087ca67a3ce25a83.png)

```julia
f = Figure()

lims = Node(((0.0, 1.3), (7.6, 10.0)))

g = f[1, 1] = GridLayout()

ax_top = Axis(f[1, 1][1, 1], title = "Broken Y-Axis")
ax_bottom = Axis(f[1, 1][2, 1])

on(lims) do (bottom, top)
    ylims!(ax_bottom, bottom)
    ylims!(ax_top, top)
    rowsize!(g, 1, Auto(top[2] - top[1]))
    rowsize!(g, 2, Auto(bottom[2] - bottom[1]))
end

hidexdecorations!(ax_top, grid = false)
ax_top.bottomspinevisible = false
ax_bottom.topspinevisible = false

linkxaxes!(ax_top, ax_bottom)
rowgap!(g, 10)

angle = pi/8
linelength = 30

segments = lift(
        @lift($(ax_top.elements[:yaxis].attributes.endpoints)[1]),
        @lift($(ax_bottom.elements[:yaxis].attributes.endpoints)[2]),
        @lift($(ax_top.elements[:yoppositeline][1])[1]),
        @lift($(ax_bottom.elements[:yoppositeline][1])[2]),
    ) do p1, p2, p3, p4
    ps = Point2f0[p1, p2, p3, p4]

    map(ps) do p
        a = p + Point2f0(cos(angle), sin(angle)) * 0.5 * linelength
        b = p - Point2f0(cos(angle), sin(angle)) * 0.5 * linelength
        (a, b)
    end
end

linesegments!(f.scene, segments)

scatter!(ax_top, randn(100, 2) .* 0.5 .+ 9)
scatter!(ax_bottom, randn(100, 2) .* 0.2 .+ 0.25)

notify(lims)

f

```

---

_[View the full topic](https://discourse.julialang.org/t/break-axis-in-makie/62729)._
