# Multiple plots -- only legends on some

**URL:** https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410
**Category:** Visualization
**Created:** [June 4, 2018, 11:29am UTC](https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410 "2018-06-04T11:29:19Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [June 4, 2018, 11:29am UTC](https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410/1 "2018-06-04T11:29:19Z")

</div>

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:

```nohighlight
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

```nohighlight
C:\Users\BLI\.julia\v0.6\Conda\deps\usr\lib\site-packages\matplotlib\legend.py:588: 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.

Question:

- 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.]

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [June 4, 2018, 11:47am UTC](https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410/2 "2018-06-04T11:47:37Z")

</div>

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

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [June 4, 2018, 12:18pm UTC](https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410/3 "2018-06-04T12:18:50Z")

</div>

Great! Much better syntax for avoiding label…

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

 ![image](https://global.discourse-cdn.com/julialang/original/3X/9/6/9697110729131153ee39e5008136f5fa1f10cf1b.png)

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.

---

<div class="post-metadata">

### Author: ![mkborregaard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mkborregaard/32/556_2.png) [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)
#### Post date: [June 4, 2018, 1:23pm UTC](https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410/4 "2018-06-04T13:23:25Z")

</div>

hm that’s a bug then ☹

---

<div class="post-metadata">

### Author: ![BLI](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bli/32/37206_2.png) [@BLI](https://discourse.julialang.org/u/BLI)
#### Post date: [June 4, 2018, 1:29pm UTC](https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410/5 "2018-06-04T13:29:56Z")

</div>

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

---

<div class="post-metadata">

### Author: ![louisponet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/louisponet/32/2070_2.png) [@louisponet](https://discourse.julialang.org/u/louisponet)
#### Post date: [June 4, 2018, 8:59pm UTC](https://discourse.julialang.org/t/multiple-plots-only-legends-on-some/11410/6 "2018-06-04T20:59:06Z")

</div>

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