# Help in PyPlot - Julia v1.0 - label and spline ( using ATOM )

**URL:** <https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572>\
**Category:** General Usage\
**Created:** [August 16, 2018, 1:54pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572 "2018-08-16T13:54:06Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![leaoshark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leaoshark/32/11462_2.png) [@leaoshark](https://discourse.julialang.org/u/leaoshark)\
**Post date:** [August 16, 2018, 1:54pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572/1 "2018-08-16T13:54:06Z")

</div>

in this command

> using PyPlot  
> x = 1:10; y = rand(10,2)  
> plot(x,y, label(“Line 1” “Line 2”)  
> title(“Two Lines”)

why the name of the line does not appear ?

and how can i spline this lines ? ( just for an example, my plot is more complicated )

---

<div class="post-metadata">

**Author:** ![slowbrain](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/slowbrain/32/2224_2.png) [@slowbrain](https://discourse.julialang.org/u/slowbrain)\
**Post date:** [August 16, 2018, 2:02pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572/2 "2018-08-16T14:02:45Z")

</div>

ignoring couple of typos in your example

try following to get legend

```julia
PyPlot.legend()

```

---

<div class="post-metadata">

**Author:** ![leaoshark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leaoshark/32/11462_2.png) [@leaoshark](https://discourse.julialang.org/u/leaoshark)\
**Post date:** [August 16, 2018, 2:08pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572/3 "2018-08-16T14:08:00Z")

</div>

> [@leaoshark](#):
>
> label(“Line 1” “Line 2”)

does not work

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [August 16, 2018, 2:12pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572/4 "2018-08-16T14:12:51Z")

</div>

label=[“line 1” “line 2”]

---

<div class="post-metadata">

**Author:** ![leaoshark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leaoshark/32/11462_2.png) [@leaoshark](https://discourse.julialang.org/u/leaoshark)\
**Post date:** [August 16, 2018, 3:29pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572/5 "2018-08-16T15:29:33Z")

</div>

now work too

---

<div class="post-metadata">

**Author:** ![leaoshark](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/leaoshark/32/11462_2.png) [@leaoshark](https://discourse.julialang.org/u/leaoshark)\
**Post date:** [August 17, 2018, 6:03pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572/6 "2018-08-17T18:03:40Z")

</div>

any help ??

---

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [August 17, 2018, 7:03pm UTC](https://discourse.julialang.org/t/help-in-pyplot-julia-v1-0-label-and-spline-using-atom/13572/7 "2018-08-17T19:03:03Z")

</div>

The `legend` function in matplotlib (hence PyPlot) takes an array (this is explained in the documentation: type `?legend` or google “legend matplotlib”).

```julia
using PyPlot
x = 1:10; y = rand(10,2)
plot(x,y)
legend(["Line 1", "Line 2"])
title("Two Lines")

```

Matplotlib does not do spline interpolation, as far as I know. You have to use some other package (e.g. Interpolations.jl) to do the interplation and then plot that.
