# Centred subplot in Makie

**URL:** <https://discourse.julialang.org/t/centred-subplot-in-makie/107660>\
**Category:** Visualization\
**Tags:** makie, makielayout\
**Created:** [December 15, 2023, 12:41pm UTC](https://discourse.julialang.org/t/centred-subplot-in-makie/107660 "2023-12-15T12:41:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xztt](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xztt/32/33843_2.png) [@xztt](https://discourse.julialang.org/u/xztt)\
**Post date:** [December 15, 2023, 12:41pm UTC](https://discourse.julialang.org/t/centred-subplot-in-makie/107660/1 "2023-12-15T12:41:23Z")

</div>

Hi,

I am looking for a way to do the below in the image. I know I could generate a subplot which spans the whole length of A and B however I can not appear to find an intuitive way to plot a third figure C which spans half the length of and A and B.

Thanks,  
Harry

 ![image](https://global.discourse-cdn.com/julialang/original/3X/2/7/278563c5642181a0b4f308afe0f1eb5edf4c7976.png)

---

<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 15, 2023, 1:09pm UTC](https://discourse.julialang.org/t/centred-subplot-in-makie/107660/2 "2023-12-15T13:09:58Z")

</div>

One way is to use `width = Relative(0.5)`

```julia
f = Figure()
ax1 = Axis(f[1, 1])
ax2 = Axis(f[1, 2])
ax3 = Axis(f[2, 1:2], width = Relative(0.5))
f

```

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

However, if you want to place a `Label` letter next to it, it’s not great if the `Axis` reduces its own width, as then its border is harder to target via normal layouting.

You could also put C in its own GridLayout where the layout has half the width, then it’s easier to place C although the centering against A and B should then be a little bit off due to C increasing the size on the right.

```julia
f = Figure()
ax1 = Axis(f[1, 1])
Label(f[1, 1, TopRight()], "A")
ax2 = Axis(f[1, 2])
Label(f[1, 2, TopRight()], "B")
gl = GridLayout(f[2, 1:2], width = Relative(0.5))
ax3 = Axis(gl[1, 1])
Label(gl[1, 1, TopRight()], "C")
f

```

 ![grafik](https://global.discourse-cdn.com/julialang/original/3X/7/8/78af78fddf2634418645fec0b2e1ccbbcd8a0feb.png)
