标记填充样式

Matplotlib中包含的标记填充样式的参考。

另请参阅 标记填充样式 和标记路径示例

标记填充样式图示

  1. import numpy as np
  2. import matplotlib.pyplot as plt
  3. from matplotlib.lines import Line2D
  4. points = np.ones(5) # Draw 3 points for each line
  5. text_style = dict(horizontalalignment='right', verticalalignment='center',
  6. fontsize=12, fontdict={'family': 'monospace'})
  7. marker_style = dict(color='cornflowerblue', linestyle=':', marker='o',
  8. markersize=15, markerfacecoloralt='gray')
  9. def format_axes(ax):
  10. ax.margins(0.2)
  11. ax.set_axis_off()
  12. fig, ax = plt.subplots()
  13. # Plot all fill styles.
  14. for y, fill_style in enumerate(Line2D.fillStyles):
  15. ax.text(-0.5, y, repr(fill_style), **text_style)
  16. ax.plot(y * points, fillstyle=fill_style, **marker_style)
  17. format_axes(ax)
  18. ax.set_title('fill style')
  19. plt.show()

下载这个示例