# Only one legend for scenarios

**URL:** https://discourse.julialang.org/t/only-one-legend-for-scenarios/48991
**Category:** General Usage
**Created:** [October 25, 2020, 6:40pm UTC](https://discourse.julialang.org/t/only-one-legend-for-scenarios/48991 "2020-10-25T18:40:34Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Arega\_Getaneh](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)
#### Post date: [October 25, 2020, 6:40pm UTC](https://discourse.julialang.org/t/only-one-legend-for-scenarios/48991/1 "2020-10-25T18:40:34Z")

</div>

I wanted to have only one legened for this scenario generated plot instead of 11 similar names over my plot. How can I do that?

```julia

t= [1; 2; 3; 4; 5; 6; 7;8; 9; 10; 11; 12]
y= rand(12,24)
plot(t,y, color="blue", linewidth=0.3, linestyle="-", marker="x", label="legend")
legend()
```

---

<div class="post-metadata">

### Author: ![lmiq](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lmiq/32/18314_2.png) [@lmiq](https://discourse.julialang.org/u/lmiq)
#### Post date: [October 25, 2020, 8:42pm UTC](https://discourse.julialang.org/t/only-one-legend-for-scenarios/48991/2 "2020-10-25T20:42:58Z")

</div>

Plot one of them separately with the legend. And the other ones without the legend.

---

<div class="post-metadata">

### Author: ![Arega\_Getaneh](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)
#### Post date: [October 25, 2020, 9:18pm UTC](https://discourse.julialang.org/t/only-one-legend-for-scenarios/48991/3 "2020-10-25T21:18:18Z")

</div>

The idea is just I need only one “legend” to be appear for the Whole scenario generated plots. As you can see, we have 24 plots and 24 lables according to the above code. I do need only one legend for all of them. Then I do not understand what u mean ploting separetly.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [October 25, 2020, 9:25pm UTC](https://discourse.julialang.org/t/only-one-legend-for-scenarios/48991/4 "2020-10-25T21:25:28Z")

</div>

I think Leandro means calling

```julia
plot(t, y[1, :], label = "legend")
plot!(t, y[2:end, :], label = "")

```

Alternatively, you can do:

```julia
plot(t,y, label= permutedims(["legend"; ["" for _ ∈ 1:23]]))

```

---

<div class="post-metadata">

### Author: ![Arega\_Getaneh](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)
#### Post date: [October 25, 2020, 9:45pm UTC](https://discourse.julialang.org/t/only-one-legend-for-scenarios/48991/5 "2020-10-25T21:45:23Z")

</div>

Ok! that way, it is possible with _y[:,1]_

with label and _y[:,2:end]_ without label.  
Thanks
