# Why is my custom plot a scene in Makie.jl

**URL:** <https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733>\
**Category:** Visualization\
**Tags:** question, makie\
**Created:** [November 18, 2021, 4:44pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733 "2021-11-18T16:44:24Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![josuagrw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josuagrw/32/1015_2.png) [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Post date:** [November 18, 2021, 4:44pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/1 "2021-11-18T16:44:24Z")

</div>

I defined my own recipe for animation in Makie.jl and I wanted to rotate that scene. After a lot of trial and error I tried rotating the plot object, by adding to the method

```julia
function plot!(customplot::CustomPlot)
    ...
    y, x = sincos(0.25pi)
    rotate!(customplot, Quaternionf0(x, 0, y, 0))

    customplot
end

```

For some reason this works, even though `customplot` is not a Scene or LScene.

Please, can someone explain why? I feel like nothing makes sense at this point.

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [November 18, 2021, 5:03pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/2 "2021-11-18T17:03:23Z")

</div>

Could you provide a minimal reproducible example? (i.e, with the definition of customPlot included, etc.

---

<div class="post-metadata">

**Author:** ![josuagrw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josuagrw/32/1015_2.png) [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Post date:** [November 18, 2021, 5:12pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/3 "2021-11-18T17:12:28Z")

</div>

no, this is not a bug report

---

<div class="post-metadata">

**Author:** ![aramirezreyes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/aramirezreyes/32/42573_2.png) [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Post date:** [November 18, 2021, 5:15pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/4 "2021-11-18T17:15:00Z")

</div>

What made you think I was suggesting this is a bug report?

I it easier to figure out something if people can just copy, paste and run and see what exactly were you referring to, but you are not obligated to do it by any means.

---

<div class="post-metadata">

**Author:** ![josuagrw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josuagrw/32/1015_2.png) [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Post date:** [November 18, 2021, 5:17pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/5 "2021-11-18T17:17:32Z")

</div>

This is a straight forward question about the API. Why are custom plots defined with the `@recipe` macro effectively scenes that I can rotate?

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 18, 2021, 5:18pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/6 "2021-11-18T17:18:14Z")

</div>

This should rotate the plot and not the scene, which seems like what you want? Rotating the scene would be a global operation, so nothing a recipe should be able to do… If this actually rotates the parent scene, it would be a bug 😅

---

<div class="post-metadata">

**Author:** ![josuagrw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josuagrw/32/1015_2.png) [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Post date:** [November 18, 2021, 5:20pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/7 "2021-11-18T17:20:04Z")

</div>

I have a 3D scene/plot/situation with some meshes. And I want to rotate what is displayed on my screen. I don’t have any layout beyond that. So I guess rotating the scene or the plot doesnt make a difference (not that I have really understood the difference)

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 18, 2021, 5:21pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/8 "2021-11-18T17:21:46Z")

</div>

Rotating a scene rotates all sub-scenes and plots in that scene… I’m actually wiring some docs right now about transformations and the scene graph

---

<div class="post-metadata">

**Author:** ![josuagrw](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/josuagrw/32/1015_2.png) [@josuagrw](https://discourse.julialang.org/u/josuagrw)\
**Post date:** [November 18, 2021, 5:21pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/9 "2021-11-18T17:21:46Z")

</div>

If I am rotating the plot rather than the scene—how is that possible? It’s not documented anywhere in the manual.

---

<div class="post-metadata">

**Author:** ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)\
**Post date:** [November 18, 2021, 5:28pm UTC](https://discourse.julialang.org/t/why-is-my-custom-plot-a-scene-in-makie-jl/71733/10 "2021-11-18T17:28:27Z")

</div>

It is quite possible, that things are not always documented in open source projects mainly maintained by volunteers.

You’re lucky though, since by coincidence, I’m currently working in my free time on improving those docs…
