线型样式参考
Matplotlib附带的线型参考。

import numpy as npimport matplotlib.pyplot as pltcolor = 'cornflowerblue'points = np.ones(5) # Draw 5 points for each linetext_style = dict(horizontalalignment='right', verticalalignment='center',fontsize=12, fontdict={'family': 'monospace'})def format_axes(ax):ax.margins(0.2)ax.set_axis_off()# Plot all line styles.fig, ax = plt.subplots()linestyles = ['-', '--', '-.', ':']for y, linestyle in enumerate(linestyles):ax.text(-0.1, y, repr(linestyle), **text_style)ax.plot(y * points, linestyle=linestyle, color=color, linewidth=3)format_axes(ax)ax.set_title('line styles')plt.show()
