# Change layering of plots?

**URL:** <https://discourse.julialang.org/t/change-layering-of-plots/50053>\
**Category:** New to Julia\
**Tags:** plotting\
**Created:** [November 12, 2020, 2:39pm UTC](https://discourse.julialang.org/t/change-layering-of-plots/50053 "2020-11-12T14:39:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [November 12, 2020, 2:39pm UTC](https://discourse.julialang.org/t/change-layering-of-plots/50053/1 "2020-11-12T14:39:13Z")

</div>

Hi!

Using the plotting tools in Julia, am I able to rearrange which line overlaps another line? Suppose I have a case like this:

 ![image](https://global.discourse-cdn.com/julialang/original/3X/5/0/50bc0088a632f7c15e5ca344fec19f9240114077.png)

I want to plot the black vertical lines first, so they appear first in the legend, but then I also want them to be at the front, so all other plotted lines are behind them. How can I do this?

Kind regards

---

<div class="post-metadata">

**Author:** ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Post date:** [November 12, 2020, 5:46pm UTC](https://discourse.julialang.org/t/change-layering-of-plots/50053/2 "2020-11-12T17:46:50Z")

</div>

I am not sure if there is an elegant way to do that, but you can trick the legend by plotting twice. For example:

```julia
julia> using Plots

julia> plot([x[1]],[y[1]],label="Black",color=:black)

julia> plot!(x,y,label="Red",color=:red)

julia> plot!(x,y,label="",color=:black)

```

![test](https://global.discourse-cdn.com/julialang/original/3X/a/c/ac3bcb700ad140770c830c9aaf6937c25d55c898.png)

---

<div class="post-metadata">

**Author:** ![Ahmed\_Salih](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ahmed_salih/32/206579_2.png) [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Post date:** [November 13, 2020, 1:13pm UTC](https://discourse.julialang.org/t/change-layering-of-plots/50053/3 "2020-11-13T13:13:28Z")

</div>

Yeah, was the same conclusion I reached…

Unfortunate, but seems like the only option

Kind regards
