Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Matplotlib: Set line style for line plot

📅 2012-Oct-02 ⬩ ✍️ Ashwin Nanjappa ⬩ 🏷️ line plot, line style, matplotlib ⬩ 📚 Archive

Matplotlib is a plotting library written in Python that can be used to create line plots. By default, all the lines are drawn with a solid line.

To set a line style assign it to the named argument linestyle in the call to pyplot.plot():

matplotlib.pyplot.plot( ..., linestyle="--" )

The list of all supported line styles and their usage can be found here.

Tried with: Matplotlib 1.2, Python 3.2.3 and Windows 7 x64

© 2023 Ashwin Nanjappa • All writing under CC BY-SA license • 🐘 Mastodon📧 Email