Plots (plotly) multiple series or line labels in legend


#1

how does one label two lines?

using Plots; pyplot()
plot(Plots.fakedata(50,2), w=3, labels=[ "a", "b" ])

the blue line is not labeled “a” and the red line is not labeled “b” .

PS: http://docs.juliaplots.org/latest/attributes/ writes “if label is empty”…what is empty?


#2

This is the #1 most asked question on Plots. The answer is that columns are series - so you should use a row matrix. label = ["a" "b"].
There’s an open issue to change the behaviour to accept a Vector.