Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates > by-pkgid > dc303dcad9fdd039290b4e78a58ed938 > files > 502

python-matplotlib-0.99.1.2-4.fc13.i686.rpm

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

Path = mpath.Path

fig = plt.figure()
ax = fig.add_subplot(111)
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.draw()