Note

Go to the endto download the full example code.

Bezier curve#

This example showcases thePathPatch object to create a Bezierpolycurve path patch.

importmatplotlib.pyplotaspltimportmatplotlib.patchesasmpatchesimportmatplotlib.pathasmpathPath=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()
The red point should be on the path

References

The use of the following functions, methods, classes and modules is shownin this example:

Gallery generated by Sphinx-Gallery