# Visual connection between different axes in Makie.jl

**URL:** https://discourse.julialang.org/t/visual-connection-between-different-axes-in-makie-jl/116535
**Category:** Visualization
**Tags:** makie, cairomakie
**Created:** [July 2, 2024, 5:00pm UTC](https://discourse.julialang.org/t/visual-connection-between-different-axes-in-makie-jl/116535 "2024-07-02T17:00:24Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![albertomercurio](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/albertomercurio/32/27051_2.png) [@albertomercurio](https://discourse.julialang.org/u/albertomercurio)
#### Post date: [July 13, 2024, 3:00pm UTC](https://discourse.julialang.org/t/visual-connection-between-different-axes-in-makie-jl/116535/9 "2024-07-13T15:00:42Z")

</div>

```julia

using CairoMakie

function posFig(ax, x, y)
    o = ax.scene.viewport[].origin
    return Makie.project(ax.scene, Point2f(x, y)) + o
end

fig = Figure()
ax1 = Axis(fig[1, 1:3])
ax2 = Axis(fig[2, 1])
ax3 = Axis(fig[2, 2])
ax4 = Axis(fig[2, 3])

pts1 = [posFig(ax1, 5, 2), posFig(ax2, 5, 5)]
pts2 = [posFig(ax1, 5, 2), posFig(ax3, 5, 5)]
pts3 = [posFig(ax1, 5, 2), posFig(ax4, 5, 5)]

lines!(fig.scene, getindex.(pts1, 1), getindex.(pts1, 2))
lines!(fig.scene, getindex.(pts2, 1), getindex.(pts2, 2))
lines!(fig.scene, getindex.(pts3, 1), getindex.(pts3, 2))

fig

```

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

---

_[View the full topic](https://discourse.julialang.org/t/visual-connection-between-different-axes-in-makie-jl/116535)._
