Why certain line styles do not work in matplotlib?

Viewed 234
1 Answers

Matplotlib's plot() function lets you control the linestyle as well as the marker. If you notice, the styles webpage you provided (https://matplotlib.org/2.1.1/api/_as_gen/matplotlib.pyplot.plot.html) provides characters for line styles and for markers.

You can pass these as separate arguments to plot():

axes[0].plot(x, y, ls='--', marker='>')

Or you can combine them into a single format string:

axes[0].plot(x, y, '-->')

Or just plot the markers or line on their own:

axes[0].plot(x, y, '--') # line only
axes[0].plot(x, y, '>')  # markers only
Related