Odd behaviour of labels with plotlyjs in Plots.jl

Hi all,

I’m having a bit of trouble with labels when using plotlyjs() in Plots.jl. I’m running Julia v0.5 on Ubuntu 16.04, with Plots 0.10.3, and PlotlyJS 0.6.0. Working in the REPL:

using Plots
plotlyjs()
plot(randn(10, 2))

produces two lines with a legend that has labels “y1” and “y2” (the default labels). All good so far. Now I try:

plot(randn(10, 2), label=["hello", "world"])

and I get a legend that has labels “trace 0” and “trace 1”. Am I doing something stupid here? I know Plots.jl is under heavy development, so if this is a bug and it would be useful for me to file a bug report, please let me know and I will do so.

Thanks in advance to all responders.

Colin

Plots.jl uses columns for each separate “series” (line). Your labels should match that. This you want your one label per column, i.e. you want a row vector label=["hello" "world"]

3 Likes

Gah! Sorry, I should have tried that.

Thanks for the quick reply.

Colin