8000 Merge pull request #15227 from timhoffm/doc-contains-point2 · matplotlib/matplotlib@1ea4b04 · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ea4b04

Browse files
authored
Merge pull request #15227 from timhoffm/doc-contains-point2
contains_point() docstring fixes
2 parents 85210e0 + b7be973 commit 1ea4b04

File tree

2 files changed

+22
-20
lines changed

2 files changed

+22
-20
lines changed

lib/matplotlib/patches.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,13 @@ def contains_point(self, point, radius=None):
159159
Parameters
160160
----------
161161
point : (float, float)
162-
The point (x, y) to check in target coordinates of
163-
``self.get_transform()``. For patches added to a figure or axes,
164-
these are display coordinates.
162+
The point (x, y) to check, in target coordinates of
163+
``self.get_transform()``. These are display coordinates for patches
164+
that are added to a figure or axes.
165165
radius : float, optional
166-
Adds an additional margin on the patch in coordinates of transform.
167-
target. See `.Path.contains_point` for further details.
166+
Add an additional margin on the patch in target coordinates of
167+
``self.get_transform()``. See `.Path.contains_point` for further
168+
details.
168169
169170
Returns
170171
-------
@@ -173,9 +174,9 @@ def contains_point(self, point, radius=None):
173174
Notes
174175
-----
175176
The proper use of this method depends on the transform of the patch.
176-
Isolated patches do not have a transform. In this, the patch creation
177-
coordinates and the point coordinates match. The follow checks that
178-
the center of a circle is within the circle
177+
Isolated patches do not have a transform. In this case, the patch
178+
creation coordinates and the point coordinates match. The following
179+
example checks that the center of a circle is within the circle
179180
180181
>>> center = 0, 0
181182
>>> c = Circle(center, radius=1)
@@ -208,12 +209,13 @@ def contains_points(self, points, radius=None):
208209
Parameters
209210
----------
210211
points : (N, 2) array
211-
The points to check in target coordinates of
212-
``self.get_transform()``. For patches added to a figure or axes,
213-
these are display coordinates. Columns contain x and y values.
212+
The points to check, in target coordinates of
213+
``self.get_transform()``. These are display coordinates for patches
214+
that are added to a figure or axes. Columns contain x and y values.
214215
radius : float, optional
215-
Adds an additional margin on the patch in coordinates of transform.
216-
target. See `.Path.contains_points` for further details.
216+
Add an additional margin on the patch in target coordinates of
217+
``self.get_transform()``. See `.Path.contains_point` for further
218+
details.
217219
218220
Returns
219221
-------

lib/matplotlib/path.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -457,15 +457,15 @@ def contains_point(self, point, transform=None, radius=0.0):
457457
point : (float, float)
458458
The point (x, y) to check.
459459
transform : `matplotlib.transforms.Transform`, optional
460-
If not ``None``, *point* will be compared to self transformed
460+
If not ``None``, *point* will be compared to ``self`` transformed
461461
by *transform*; i.e. for a correct check, *transform* should
462462
transform the path into the coordinate system of *point*.
463-
radius : float, default: 0.
464-
Adds an additional margin on the path in coordinates of *point*.
463+
radius : float, default: 0
464+
Add an additional margin on the path in coordinates of *point*.
465465
The path is extended tangentially by *radius/2*; i.e. if you would
466466
draw the path with a linewidth of *radius*, all points on the line
467467
would still be considered to be contained in the area. Conversely,
468-
negative values shrink the area; points on the imaginary line
468+
negative values shrink the area: Points on the imaginary line
469469
will be considered outside the area.
470470
471471
Returns
@@ -492,15 +492,15 @@ def contains_points(self, points, transform=None, radius=0.0):
492492
points : (N, 2) array
493493
The points to check. Columns contain x and y values.
494494
transform : `matplotlib.transforms.Transform`, optional
495-
If not ``None``, *points* will be compared to self transformed
495+
If not ``None``, *points* will be compared to ``self`` transformed
496496
by *transform*; i.e. for a correct check, *transform* should
497497
transform the path into the coordinate system of *points*.
498498
radius : float, default: 0.
499-
Adds an additional margin on the path in coordinates of *points*.
499+
Add an additional margin on the path in coordinates of *points*.
500500
The path is extended tangentially by *radius/2*; i.e. if you would
501501
draw the path with a linewidth of *radius*, all points on the line
502502
would still be considered to be contained in the area. Conversely,
503-
negative values shrink the area; points on the imaginary line
503+
negative values shrink the area: Points on the imaginary line
504504
will be considered outside the area.
505505
506506
Returns

0 commit comments

Comments
 (0)
0