# Julia, how to plot behind previous plot (how to push a plot to the backgrown of another plot)

**URL:** <https://discourse.julialang.org/t/julia-how-to-plot-behind-previous-plot-how-to-push-a-plot-to-the-backgrown-of-another-plot/95093>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [February 23, 2023, 5:04pm UTC](https://discourse.julialang.org/t/julia-how-to-plot-behind-previous-plot-how-to-push-a-plot-to-the-backgrown-of-another-plot/95093 "2023-02-23T17:04:34Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [February 23, 2023, 5:16pm UTC](https://discourse.julialang.org/t/julia-how-to-plot-behind-previous-plot-how-to-push-a-plot-to-the-backgrown-of-another-plot/95093/2 "2023-02-23T17:16:32Z")

</div>

Make sure to speficy the plotting package you are using - there are a number of good options in Julia and they all work differently so an answer can only be helpful if it discussed the one you’re actually using.

From your code snippet I guess you are using Makie, in which case this discussion might be relevant:

> [@Algebra of Graphics z-order? Controlling the plotting order](https://discourse.julialang.org/t/algebra-of-graphics-z-order-controlling-the-plotting-order/66112/3):
>
> There was an “optimization” that scrambled the plotting order, should be addressed by [this PR](https://github.com/JuliaPlots/AlgebraOfGraphics.jl/pull/254) (docs preview [here](http://juliaplots.org/AlgebraOfGraphics.jl/previews/PR254/)). This way the “z-order” should follow the sorting order (smaller values get drawn first and appear first in the legend). This is the same as one would get by doing the plot directly in Makie, so it should be a reasonable default. Could you check out the PR and see if it fixes your usecase? For more nuanced situations (say one wants to order plots and legend differently, or more comp…

---

_[View the full topic](https://discourse.julialang.org/t/julia-how-to-plot-behind-previous-plot-how-to-push-a-plot-to-the-backgrown-of-another-plot/95093)._
