Double legend with twinx()

A hack:

plot(1:10, 1:10, seriestype = :bar, label = "1", alpha = 0.4)
plot!(1:10, NaN.*(1:10), label = "2", linecolor=:green, grid=false, legend=:left) 
plot!(twinx(), 1:10, 501:510, legend=false, linecolor=:green)

PS: please quote your code PSA: how to quote code with backticks

3 Likes