标记路径
import matplotlib.pyplot as pltimport matplotlib.path as mpathimport numpy as npstar = mpath.Path.unit_regular_star(6)circle = mpath.Path.unit_circle()# concatenate the circle with an internal cutout of the starverts = np.concatenate([circle.vertices, star.vertices[::-1, ...]])codes = np.concatenate([circle.codes, star.codes])cut_star = mpath.Path(verts, codes)plt.plot(np.arange(10)**2, '--r', marker=cut_star, markersize=15)plt.show()

参考
此示例中显示了以下函数,方法,类和模块的使用:
import matplotlibmatplotlib.pathmatplotlib.path.Pathmatplotlib.path.Path.unit_regular_starmatplotlib.path.Path.unit_circlematplotlib.axes.Axes.plotmatplotlib.pyplot.plot
