Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 95a5df9

Browse files
authored
Merge pull request #8490 from anntzer/clarify-contains_x-docstring
DOC: Clarify that Path.contains_x implicitly closes the Path.
2 parents 4efca09 + ced591b commit 95a5df9

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

lib/matplotlib/path.py

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -482,13 +482,12 @@ def transformed(self, transform):
482482

483483
def contains_point(self, point, transform=None, radius=0.0):
484484
"""
485-
Returns *True* if the path contains the given point.
485+
Returns whether the (closed) path contains the given point.
486486
487-
If *transform* is not *None*, the path will be transformed
488-
before performing the test.
487+
If *transform* is not ``None``, the path will be transformed before
488+
performing the test.
489489
490-
*radius* allows the path to be made slightly larger or
491-
smaller.
490+
*radius* allows the path to be made slightly larger or smaller.
492491
"""
493492
if transform is not None:
494493
transform = transform.frozen()
@@ -503,14 +502,13 @@ def contains_point(self, point, transform=None, radius=0.0):
503502

504503
def contains_points(self, points, transform=None, radius=0.0):
505504
"""
506-
Returns a bool array which is *True* if the path contains the
507-
corresponding point.
505+
Returns a bool array which is ``True`` if the (closed) path contains
506+
the corresponding point.
508507
509-
If *transform* is not *None*, the path will be transformed
510-
before performing the test.
508+
If *transform* is not ``None``, the path will be transformed before
509+
performing the test.
511510
512-
*radius* allows the path to be made slightly larger or
513-
smaller.
511+
*radius* allows the path to be made slightly larger or smaller.
514512
"""
515513
if transform is not None:
516514
transform = transform.frozen()
@@ -519,10 +517,10 @@ def contains_points(self, points, transform=None, radius=0.0):
519517

520518
def contains_path(self, path, transform=None):
521519
"""
522-
Returns *True* if this path completely contains the given path.
520+
Returns whether this (closed) path completely contains the given path.
523521
524-
If *transform* is not *None*, the path will be transformed
525-
before performing the test.
522+
If *transform* is not ``None``, the path will be transformed before
523+
performing the test.
526524
"""
527525
if transform is not None:
528526
transform = transform.frozen()

0 commit comments

Comments
 (0)