Multiple plots -- only legends on some


I plot multiple time series in the same plot, one with nominal parameter value and the others a result of Monte Carlo runs. I only want label on the one with nominal value…

I tried to do:

plot(…, label="_nolabel_")

for those plots where I don’t want a label (taken from syntax for matplotlib…), and this works with the pyplot backend of Plots: I get loads of error messages in IJulia, but the plot is ok. The error messages are typically

C:\Users\BLI\.julia\v0.6\Conda\deps\usr\lib\site-packages\matplotlib\ UserWarning: The handle <matplotlib.lines.Line2D object at 0x0000000052A27BE0> has a label of '_nolabel_' which cannot be automatically added to the legend.
  'legend.'.format(handle, label))

– one for each "_nolabel_" label, I guess…

I get a similar error message when I try to savefig() the plot.


  • Is this the way to do it in general in Plots, or is there a better way?

[Backend gr() doesn’t support the plot(…,label="_nolabel_") syntax, and also doesn’t appear to support LaTeX syntax.]


just label = "" . Latex syntax is provided by LaTeXStrings.


Great! Much better syntax for avoiding label…

The gr backend doesn’t support LaTeX code, though…

I am using LaTeXStrings. Notice that xlabel and ylabel are not typeset correctly using gr backend. (The label, is, however, probalby typeset as it should – but doesn’t look particularly nice in IJulia… ). Using pyplot, however, the result is correct.


hm that’s a bug then :frowning:


Maybe a bug, but should be easy to fix ? :-).


I found that it only supports latexstrings on the entire string. I.e. what seems to not be working are the $ signs.