# Makie recipe with multiple axes

**URL:** <https://discourse.julialang.org/t/makie-recipe-with-multiple-axes/121013>\
**Category:** Visualization\
**Tags:** question, makie, recipe\
**Created:** [October 7, 2024, 2:14pm UTC](https://discourse.julialang.org/t/makie-recipe-with-multiple-axes/121013 "2024-10-07T14:14:09Z")\
**Posts on this page:** 5\
**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:** [October 7, 2024, 2:14pm UTC](https://discourse.julialang.org/t/makie-recipe-with-multiple-axes/121013/1 "2024-10-07T14:14:09Z")

</div>

Is it currently possible to define a recipe with multiple axes in Makie.jl? Say I have a full recipe called `MyPlot` that acts on a type `T`, I want the call `myplot(obj::T)` to return a figure with 2x2 grid layout filled with different plots. How to do this?

---

<div class="post-metadata">

**Author:** ![co1emi11er](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/co1emi11er/32/206849_2.png) [@co1emi11er](https://discourse.julialang.org/u/co1emi11er)\
**Post date:** [October 7, 2024, 2:42pm UTC](https://discourse.julialang.org/t/makie-recipe-with-multiple-axes/121013/2 "2024-10-07T14:42:13Z")

</div>

The [SpecApi | Makie](https://docs.makie.org/stable/explanations/specapi) is probably what you need. Although it is experimental for now.

---

<div class="post-metadata">

**Author:** ![aplavin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aplavin/32/222056_2.png) [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Post date:** [October 7, 2024, 2:46pm UTC](https://discourse.julialang.org/t/makie-recipe-with-multiple-axes/121013/3 "2024-10-07T14:46:40Z")

</div>

Just write a function

> [@juliohm](#):
>
> `myplot(obj::T)`

🙂

That’s definitely the easiest and most reliable approach. You don’t get the composability of recipes, but sounds you don’t need a lot of it anyway because you want to return the whole figure.

---

<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:** [October 7, 2024, 4:12pm UTC](https://discourse.julialang.org/t/makie-recipe-with-multiple-axes/121013/4 "2024-10-07T16:12:37Z")

</div>

Can we return a `Makie.SpecApi` in a full recipe? I’ve read that API in the past, but understood it is intended for end-users, not recipe writers.

---

<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:** [October 7, 2024, 4:13pm UTC](https://discourse.julialang.org/t/makie-recipe-with-multiple-axes/121013/5 "2024-10-07T16:13:15Z")

</div>

That is one way out. It is unfortunate that we can’t create recipes with multiple axes yet.
