Change layering of plots?


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

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

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> 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)


Yeah, was the same conclusion I reached…

Unfortunate, but seems like the only option

Kind regards