-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Labels
Milestone
Description
I tried to use contains_point
method of Patch
to check if some point is inside the closed path, e.g.
I defined an ellipse with the center, width, height and angle parameters:
>>> from matplotlib.patches import Ellipse
>>> e1 = Ellipse((3,5), 10, 8, 20)
>>> e1.contains_point((3,5))
True
The last line prints out True
, which means the center is in the defined ellipse. But after I added the e1
to an axes, the same line just print out False
, e.g.
>>> import matplotlib.pyplot as plt
>>> from matplotlib.patches import Ellipse
>>> fig, ax = plt.subplots()
>>> e1 = Ellipse((3,5), 10, 8, 20)
>>> e1.contains_point((3,5))
True
>>> ax.add_patch(e1)
>>> e1.contains_point((3,5))
False
I'm testing the above with matplotlib of version 3.0.3. Is this a bug? Or something I did was not correct? Thanks!