Skip to content

contains_point() docstring fixes #15227

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions lib/matplotlib/patches.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,13 @@ def contains_point(self, point, radius=None):
Parameters
----------
point : (float, float)
The point (x, y) to check in target coordinates of
``self.get_transform()``. For patches added to a figure or axes,
these are display coordinates.
The point (x, y) to check, in target coordinates of
``self.get_transform()``. These are display coordinates for patches
that are added to a figure or axes.
radius : float, optional
Adds an additional margin on the patch in coordinates of transform.
target. See `.Path.contains_point` for further details.
Add an additional margin on the patch in target coordinates of
``self.get_transform()``. See `.Path.contains_point` for further
details.

Returns
-------
Expand All @@ -173,9 +174,9 @@ def contains_point(self, point, radius=None):
Notes
-----
The proper use of this method depends on the transform of the patch.
Isolated patches do not have a transform. In this, the patch creation
coordinates and the point coordinates match. The follow checks that
the center of a circle is within the circle
Isolated patches do not have a transform. In this case, the patch
creation coordinates and the point coordinates match. The following
example checks that the center of a circle is within the circle

>>> center = 0, 0
>>> c = Circle(center, radius=1)
Expand Down Expand Up @@ -208,12 +209,13 @@ def contains_points(self, points, radius=None):
Parameters
----------
points : (N, 2) array
The points to check in target coordinates of
``self.get_transform()``. For patches added to a figure or axes,
these are display coordinates. Columns contain x and y values.
The points to check, in target coordinates of
``self.get_transform()``. These are display coordinates for patches
that are added to a figure or axes. Columns contain x and y values.
radius : float, optional
Adds an additional margin on the patch in coordinates of transform.
target. See `.Path.contains_points` for further details.
Add an additional margin on the patch in target coordinates of
``self.get_transform()``. See `.Path.contains_point` for further
details.

Returns
-------
Expand Down
14 changes: 7 additions & 7 deletions lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,15 +457,15 @@ def contains_point(self, point, transform=None, radius=0.0):
point : (float, float)
The point (x, y) to check.
transform : `matplotlib.transforms.Transform`, optional
If not ``None``, *point* will be compared to self transformed
If not ``None``, *point* will be compared to ``self`` transformed
by *transform*; i.e. for a correct check, *transform* should
transform the path into the coordinate system of *point*.
radius : float, default: 0.
Adds an additional margin on the path in coordinates of *point*.
radius : float, default: 0
Add an additional margin on the path in coordinates of *point*.
The path is extended tangentially by *radius/2*; i.e. if you would
draw the path with a linewidth of *radius*, all points on the line
would still be considered to be contained in the area. Conversely,
negative values shrink the area; points on the imaginary line
negative values shrink the area: Points on the imaginary line
will be considered outside the area.

Returns
Expand All @@ -492,15 +492,15 @@ def contains_points(self, points, transform=None, radius=0.0):
points : (N, 2) array
The points to check. Columns contain x and y values.
transform : `matplotlib.transforms.Transform`, optional
If not ``None``, *points* will be compared to self transformed
If not ``None``, *points* will be compared to ``self`` transformed
by *transform*; i.e. for a correct check, *transform* should
transform the path into the coordinate system of *points*.
radius : float, default: 0.
Adds an additional margin on the path in coordinates of *points*.
Add an additional margin on the path in coordinates of *points*.
The path is extended tangentially by *radius/2*; i.e. if you would
draw the path with a linewidth of *radius*, all points on the line
would still be considered to be contained in the area. Conversely,
negative values shrink the area; points on the imaginary line
negative values shrink the area: Points on the imaginary line
will be considered outside the area.

Returns
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy