Bezier曲线
此示例展示 PathPatch 对象以创建Bezier多曲线路径修补程序。
import matplotlib.path as mpathimport matplotlib.patches as mpatchesimport matplotlib.pyplot as pltPath = mpath.Pathfig, ax = plt.subplots()pp1 = mpatches.PathPatch(Path([(0, 0), (1, 0), (1, 1), (0, 0)],[Path.MOVETO, Path.CURVE3, Path.CURVE3, Path.CLOSEPOLY]),fc="none", transform=ax.transData)ax.add_patch(pp1)ax.plot([0.75], [0.25], "ro")ax.set_title('The red point should be on the path')plt.show()

参考
此示例中显示了以下函数,方法,类和模块的使用:
import matplotlibmatplotlib.pathmatplotlib.path.Pathmatplotlib.patchesmatplotlib.patches.PathPatchmatplotlib.axes.Axes.add_patch
