diff --git a/lib/matplotlib/patches.py b/lib/matplotlib/patches.py index bcaba10d35cd..4025f9a5ebb6 100644 --- a/lib/matplotlib/patches.py +++ b/lib/matplotlib/patches.py @@ -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 ------- @@ -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) @@ -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 ------- diff --git a/lib/matplotlib/path.py b/lib/matplotlib/path.py index 69af3d4c2fbb..b3f18f9eb08c 100644 --- a/lib/matplotlib/path.py +++ b/lib/matplotlib/path.py @@ -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 @@ -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