I am creating a plot with multiple lines for comparison using plot!(..)
for each new line. The line I plot first, appears at the very bottom of all the lines but at the first line of the legend. Obviously, it is very easy to get the reverse behaviour (on top of the other lines, but at the end of the legend). Is it somehow possible to make the first line I draw appear on top of the other lines AND at the same time in the first legend line?
A google search didn’t bring up anything useful; I’d also be happy using hacky solutions. Thanks!
With Gaston:
using Gaston
plot(range(1,10,step=1),
lc = :red,
lw = 8,
legend = :third,
Axes(key = "center top invert"))
plot!(range(10,1,step=-1),
lc = :blue,
lw = 3,
legend = :second)
plot!(range(3,8,length=10),
lc = :black,
lw = 3,
legend = :first)
First I configured the key
(legend box in gnuplot parlance) with the invert
option, and then I plotted the curves in reverse order.
You can just make an empty series with the same colour etc:
plot(1:0, lab="one", c=1); plot!(rand(10), lab="two", c=2, linewidth=5); plot!(rand(10), lab="", c=1, linewidth=5)