You are reading an old version of the documentation (v2.1.2). For the latest version see
Version 2.1.2
Fork me on GitHub


Related Topics

This Page

Bezier CurveΒΆ

This example showcases the PathPatch object to create a Bezier polycurve path patch.

import matplotlib.path as mpath
import matplotlib.patches as mpatches
import matplotlib.pyplot as plt

Path = mpath.Path

fig, 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.plot([0.75], [0.25], "ro")
ax.set_title('The red point should be on the path')

Total running time of the script: ( 0 minutes 0.058 seconds)

Gallery generated by Sphinx-Gallery