# Is there a linestyle vector in PyPlot?

**URL:** <https://discourse.julialang.org/t/is-there-a-linestyle-vector-in-pyplot/113619>\
**Category:** General Usage\
**Created:** [April 29, 2024, 4:28pm UTC](https://discourse.julialang.org/t/is-there-a-linestyle-vector-in-pyplot/113619 "2024-04-29T16:28:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)\
**Post date:** [April 29, 2024, 4:28pm UTC](https://discourse.julialang.org/t/is-there-a-linestyle-vector-in-pyplot/113619/1 "2024-04-29T16:28:53Z")

</div>

Is it possible to do something like plot(xy[:,1], xy[:,2:end], linestyle=[“-”,“–”]), using PyPlot?

---

<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:** [April 29, 2024, 5:30pm UTC](https://discourse.julialang.org/t/is-there-a-linestyle-vector-in-pyplot/113619/2 "2024-04-29T17:30:12Z")

</div>

You can use the [`prop_cycler` API in matplotlib](https://matplotlib.org/stable/users/explain/artists/color_cycle.html).

For example:

```julia
using PyPlot, PyCall
fig, ax = plt.subplots();
cycler = pyimport("cycler").cycler;
ax.set_prop_cycle(cycler(linestyle=["-", "--", ":", "-."]))
plot(rand(10,3))

```

(You can also just call `plot(data[:, i], linestyle=linestyles[i])` in a loop, of course.)

---

<div class="post-metadata">

**Author:** ![marllos](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/marllos/32/205917_2.png) [@marllos](https://discourse.julialang.org/u/marllos)\
**Post date:** [April 29, 2024, 6:12pm UTC](https://discourse.julialang.org/t/is-there-a-linestyle-vector-in-pyplot/113619/3 "2024-04-29T18:12:13Z")

</div>

Thank you very much
