Former-commit-id:a02aeb236c
[formerly9f19e3f712
] [formerlya02aeb236c
[formerly9f19e3f712
] [formerly06a8b51d6d
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]] Former-commit-id:06a8b51d6d
Former-commit-id:8e80217e59
[formerly3360eb6c5f
] Former-commit-id:377dcd10b9
20 lines
475 B
Python
Executable file
20 lines
475 B
Python
Executable file
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()
|
|
|