# How to link axes in a Makie figure?

**URL:** <https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [June 9, 2021, 12:31pm UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622 "2021-06-09T12:31:56Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 9, 2021, 12:31pm UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/1 "2021-06-09T12:31:56Z")

</div>

Suppose I have a figure with multiple subfigures:

```julia
using GLMakie

fig = Figure()
scatter(fig[1,1], rand(10))
scatter(fig[1,2], rand(10))

```

How to link all axes in the figure? I am aware of `linkaxes!` but it expects axes objects as input.

Is there a section of the documentation explaining the relationship between figures, scenes, axes and how to extract one from another?

---

<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 9, 2021, 12:38pm UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/2 "2021-06-09T12:38:10Z")

</div>

The figure has a content vector where objects that were created with `Axis(f...` etc should be stored. So you can filter axes from there. You can also go through the nested layouts but that’s more work. Layouts are kind of decoupled from figures, something can be in a layout but doesn’t have to be in the figure, and vice versa.

```julia
f = Figure()
for i in 1:4, j in 1:4
    scatter(f[i, j], randn(10, 2))
end

linkaxes!(filter(x -> x isa Axis, f.content)...)
f

```

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

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [June 9, 2021, 12:50pm UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/3 "2021-06-09T12:50:55Z")

</div>

Thank you @jules , am I correct that linking Axis3 is currently not available?

---

<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 9, 2021, 12:55pm UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/4 "2021-06-09T12:55:59Z")

</div>

Yes it lacks the infrastructure for that. Also I’m not sure how I would want that to work, and it might need a rework of Axis as well

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [December 11, 2023, 1:41pm UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/5 "2023-12-11T13:41:52Z")

</div>

@jules any advance regarding the link of 3D axes?

---

<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:** [December 11, 2023, 1:48pm UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/6 "2023-12-11T13:48:50Z")

</div>

Nobody has worked on that, no

---

<div class="post-metadata">

**Author:** ![kunzaatko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kunzaatko/32/25153_2.png) [@kunzaatko](https://discourse.julialang.org/u/kunzaatko)\
**Post date:** [December 13, 2023, 1:17am UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/7 "2023-12-13T01:17:23Z")

</div>

That would be super cool, but would probably require more work for linking all the observables including the rotation of the axes and so on. What would be the observables, that I need to bind in order to do this? Is there something that would be necessary to “link” besides the axis attributes?

---

<div class="post-metadata">

**Author:** ![juliohm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/juliohm/32/215266_2.png) [@juliohm](https://discourse.julialang.org/u/juliohm)\
**Post date:** [December 13, 2023, 1:26am UTC](https://discourse.julialang.org/t/how-to-link-axes-in-a-makie-figure/62622/8 "2023-12-13T01:26:15Z")

</div>

At some point the 3D axes were linked by default. I don’t know what happened in the latest releases, but they are decoupled now.
