# How can I use Makie to create a complex composite figure?

**URL:** <https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480>\
**Category:** Visualization\
**Tags:** question\
**Created:** [April 28, 2025, 7:42am UTC](https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480 "2025-04-28T07:42:57Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![cocolar201](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cocolar201/32/52913_2.png) [@cocolar201](https://discourse.julialang.org/u/cocolar201)\
**Post date:** [April 28, 2025, 7:42am UTC](https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480/1 "2025-04-28T07:42:57Z")

</div>

How can I use Makie to create a complex composite figure?  
A plot like this：

 ![捕获](https://global.discourse-cdn.com/julialang/original/3X/d/0/d0ea29deb2a90c58b4b69217f16f0f466148f8d2.jpeg)

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [April 28, 2025, 7:53am UTC](https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480/2 "2025-04-28T07:53:19Z")

</div>

Welcome to Julia discourse!

Have you tried anything already? Do you have a specific question?

The Makie docs sometimes lack some information, but a lot of examples and tutorials are there:

- [scatterlines | Makie](https://docs.makie.org/dev/reference/plots/scatterlines)
  - A line plot with markers

- [Axis | Makie](https://docs.makie.org/dev/reference/blocks/axis#Creating-a-twin-axis)
  - Drawing y-axes on both sides of the plot (so-called “twin axis”)

- [Legend | Makie](https://docs.makie.org/dev/reference/blocks/legend#Creating-Legend-Entries-Manually)
  - Creating legends manually, which offers a better control over the labels and markers

- [Creating complex layouts | Makie](https://docs.makie.org/dev/tutorials/layout-tutorial)
  - Creating complex figures with several subplots, colorbars, etc.

This should at least help you get started.

---

<div class="post-metadata">

**Author:** ![cocolar201](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/cocolar201/32/52913_2.png) [@cocolar201](https://discourse.julialang.org/u/cocolar201)\
**Post date:** [April 28, 2025, 8:22am UTC](https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480/3 "2025-04-28T08:22:51Z")

</div>

I don’t know how to partially overlay multiple layouts.

---

<div class="post-metadata">

**Author:** ![barucden](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/barucden/32/26154_2.png) [@barucden](https://discourse.julialang.org/u/barucden)\
**Post date:** [April 28, 2025, 12:05pm UTC](https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480/4 "2025-04-28T12:05:28Z")

</div>

I am not sure what you mean by overlaying multiple layouts. If you mean the two y-axes (“Flow coefficient” on the left and “Non-dimensional rig tumble” on the right) then that’s the twin axis I linked in the previous post.

---

<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:** [April 28, 2025, 12:55pm UTC](https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480/5 "2025-04-28T12:55:07Z")

</div>

I guess they mean that the twin axis occupies only part of the vertical space. That can be solved by calculating beforehand what fraction of the vertical space the twin axis occupies, then setting `height = Relative(fraction), valign = :bottom` on it

---

<div class="post-metadata">

**Author:** ![TimG](https://avatars.discourse-cdn.com/v4/letter/t/82dd89/32.png) [@TimG](https://discourse.julialang.org/u/TimG)\
**Post date:** [April 28, 2025, 2:48pm UTC](https://discourse.julialang.org/t/how-can-i-use-makie-to-create-a-complex-composite-figure/128480/6 "2025-04-28T14:48:09Z")

</div>

The left y-axis has two `step` intervals. Between 0 and 0.6, it is two squares per 0.1 units but above that it is one square per 0.2 units. It also has two axis labels, one for each segment.  
So the left axis is actually acting a bit like two axes. Is this part of the OP’s question?
