Skip to content

Clarify that Path.contains_x implicitly closes the Path. #8490

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
Apr 16, 2017
Merged
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
26 changes: 12 additions & 14 deletions lib/matplotlib/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,13 +482,12 @@ def transformed(self, transform):

def contains_point(self, point, transform=None, radius=0.0):
"""
Returns *True* if the path contains the given point.
Returns whether the (closed) path contains the given point.

If *transform* is not *None*, the path will be transformed
before performing the test.
If *transform* is not ``None``, the path will be transformed before
performing the test.

*radius* allows the path to be made slightly larger or
smaller.
*radius* allows the path to be made slightly larger or smaller.
"""
if transform is not None:
transform = transform.frozen()
Expand All @@ -503,14 +502,13 @@ def contains_point(self, point, transform=None, radius=0.0):

def contains_points(self, points, transform=None, radius=0.0):
"""
Returns a bool array which is *True* if the path contains the
corresponding point.
Returns a bool array which is ``True`` if the (closed) path contains
the corresponding point.

If *transform* is not *None*, the path will be transformed
before performing the test.
If *transform* is not ``None``, the path will be transformed before
performing the test.

*radius* allows the path to be made slightly larger or
smaller.
*radius* allows the path to be made slightly larger or smaller.
"""
if transform is not None:
transform = transform.frozen()
Expand All @@ -519,10 +517,10 @@ def contains_points(self, points, transform=None, radius=0.0):

def contains_path(self, path, transform=None):
"""
Returns *True* if this path completely contains the given path.
Returns whether this (closed) path completely contains the given path.

If *transform* is not *None*, the path will be transformed
before performing the test.
If *transform* is not ``None``, the path will be transformed before
performing the test.
"""
if transform is not None:
transform = transform.frozen()
Expand Down