@@ -33,33 +33,33 @@ class Path:
33
33
34
34
These two arrays always have the same length in the first
35
35
dimension. For example, to represent a cubic curve, you must
36
- provide three vertices and three `` CURVE4` ` codes.
36
+ provide three vertices and three `CURVE4` codes.
37
37
38
38
The code types are:
39
39
40
- - `` STOP` ` : 1 vertex (ignored)
40
+ - `STOP` : 1 vertex (ignored)
41
41
A marker for the end of the entire path (currently not required and
42
42
ignored)
43
43
44
- - `` MOVETO` ` : 1 vertex
44
+ - `MOVETO` : 1 vertex
45
45
Pick up the pen and move to the given vertex.
46
46
47
- - `` LINETO` ` : 1 vertex
47
+ - `LINETO` : 1 vertex
48
48
Draw a line from the current position to the given vertex.
49
49
50
- - `` CURVE3` ` : 1 control point, 1 endpoint
50
+ - `CURVE3` : 1 control point, 1 endpoint
51
51
Draw a quadratic Bézier curve from the current position, with the given
52
52
control point, to the given end point.
53
53
54
- - `` CURVE4` ` : 2 control points, 1 endpoint
54
+ - `CURVE4` : 2 control points, 1 endpoint
55
55
Draw a cubic Bézier curve from the current position, with the given
56
56
control points, to the given end point.
57
57
58
- - `` CLOSEPOLY` ` : 1 vertex (ignored)
58
+ - `CLOSEPOLY` : 1 vertex (ignored)
59
59
Draw a line segment to the start point of the current polyline.
60
60
61
- If *codes* is None, it is interpreted as a `` MOVETO` ` followed by a series
62
- of `` LINETO` `.
61
+ If *codes* is None, it is interpreted as a `MOVETO` followed by a series
62
+ of `LINETO`.
63
63
64
64
Users of Path objects should not access the vertices and codes arrays
65
65
directly. Instead, they should use `iter_segments` or `cleaned` to get the
@@ -121,7 +121,7 @@ def __init__(self, vertices, codes=None, _interpolation_steps=1,
121
121
If *codes* is None and closed is True, vertices will be treated as
122
122
line segments of a closed polygon. Note that the last vertex will
123
123
then be ignored (as the corresponding code will be set to
124
- CLOSEPOLY).
124
+ ` CLOSEPOLY` ).
125
125
readonly : bool, optional
126
126
Makes the path behave in an immutable way and sets the vertices
127
127
and codes as read-only arrays.
@@ -319,7 +319,7 @@ def make_compound_path_from_polys(cls, XY):
319
319
@classmethod
320
320
def make_compound_path (cls , * args ):
321
321
r"""
322
- Concatenate a list of `Path`\s into a single `. Path`, removing all `. STOP`\s.
322
+ Concatenate a list of `Path`\s into a single `Path`, removing all `STOP`\s.
323
323
"""
324
324
if not args :
325
325
return Path (np .empty ([0 , 2 ], dtype = np .float32 ))
@@ -412,7 +412,7 @@ def iter_segments(self, transform=None, remove_nans=True, clip=None,
412
412
413
413
def iter_bezier (self , ** kwargs ):
414
414
"""
415
- Iterate over each Bézier curve (lines included) in a Path.
415
+ Iterate over each Bézier curve (lines included) in a ` Path` .
416
416
417
417
Parameters
418
418
----------
@@ -421,15 +421,15 @@ def iter_bezier(self, **kwargs):
421
421
422
422
Yields
423
423
------
424
- B : matplotlib.bezier.BezierSegment
424
+ B : `~ matplotlib.bezier.BezierSegment`
425
425
The Bézier curves that make up the current path. Note in particular
426
426
that freestanding points are Bézier curves of order 0, and lines
427
427
are Bézier curves of order 1 (with two control points).
428
- code : Path.code_type
428
+ code : `~matplotlib.path. Path.code_type`
429
ED4F
td>429
The code describing what kind of curve is being returned.
430
- Path. MOVETO, Path. LINETO, Path. CURVE3, Path. CURVE4 correspond to
430
+ ` MOVETO`, ` LINETO`, ` CURVE3`, and ` CURVE4` correspond to
431
431
Bézier curves with 1, 2, 3, and 4 control points (respectively).
432
- Path. CLOSEPOLY is a Path. LINETO with the control points correctly
432
+ ` CLOSEPOLY` is a ` LINETO` with the control points correctly
433
433
chosen based on the start/end points of the current stroke.
434
434
"""
435
435
first_vert = None
@@ -461,7 +461,7 @@ def cleaned(self, transform=None, remove_nans=False, clip=None,
461
461
* , simplify = False , curves = False ,
462
462
stroke_width = 1.0 , snap = False , sketch = None ):
463
463
"""
464
- Return a new Path with vertices and codes cleaned according to the
464
+ Return a new ` Path` with vertices and codes cleaned according to the
465
465
parameters.
466
466
467
467
See Also
@@ -494,14 +494,14 @@ def contains_point(self, point, transform=None, radius=0.0):
494
494
Return whether the area enclosed by the path contains the given point.
495
495
496
496
The path is always treated as closed; i.e. if the last code is not
497
- CLOSEPOLY an implicit segment connecting the last vertex to the first
497
+ ` CLOSEPOLY` an implicit segment connecting the last vertex to the first
498
498
vertex is assumed.
499
499
500
500
Parameters
501
501
----------
502
502
point : (float, float)
503
503
The point (x, y) to check.
504
- transform : `matplotlib.transforms.Transform`, optional
504
+ transform : `~ matplotlib.transforms.Transform`, optional
505
505
If not ``None``, *point* will be compared to ``self`` transformed
506
506
by *transform*; i.e. for a correct check, *transform* should
507
507
transform the path into the coordinate system of *point*.
@@ -544,14 +544,14 @@ def contains_points(self, points, transform=None, radius=0.0):
544
544
Return whether the area enclosed by the path contains the given points.
545
545
546
546
The path is always treated as closed; i.e. if the last code is not
547
- CLOSEPOLY an implicit segment connecting the last vertex to the first
547
+ ` CLOSEPOLY` an implicit segment connecting t
1E79
he last vertex to the first
548
548
vertex is assumed.
549
549
550
550
Parameters
551
551
----------
552
552
points : (N, 2) array
553
553
The points to check. Columns contain x and y values.
554
- transform : `matplotlib.transforms.Transform`, optional
554
+ transform : `~ matplotlib.transforms.Transform`, optional
555
555
If not ``None``, *points* will be compared to ``self`` transformed
556
556
by *transform*; i.e. for a correct check, *transform* should
557
557
transform the path into the coordinate system of *points*.
@@ -600,7 +600,7 @@ def get_extents(self, transform=None, **kwargs):
600
600
601
601
Parameters
602
602
----------
603
- transform : matplotlib.transforms.Transform, optional
603
+ transform : `~ matplotlib.transforms.Transform` , optional
604
604
Transform to apply to path before computing extents, if any.
605
605
**kwargs
606
606
Forwarded to `.iter_bezier`.
@@ -658,9 +658,9 @@ def intersects_bbox(self, bbox, filled=True):
658
658
659
659
def interpolated (self , steps ):
660
660
"""
661
- Return a new path resampled to length N x steps.
661
+ Return a new path resampled to length N x * steps* .
662
662
663
- Codes other than LINETO are not handled correctly.
663
+ Codes other than ` LINETO` are not handled correctly.
664
664
"""
665
665
if steps == 1 :
666
666
return self
@@ -679,7 +679,7 @@ def to_polygons(self, transform=None, width=0, height=0, closed_only=True):
679
679
"""
680
680
Convert this path to a list of polygons or polylines. Each
681
681
polygon/polyline is an (N, 2) array of vertices. In other words,
682
- each polygon has no `` MOVETO` ` instructions or curves. This
682
+ each polygon has no `MOVETO` instructions or curves. This
683
683
is useful for displaying in backends that do not support
684
684
compound paths or Bézier curves.
685
685
@@ -1016,7 +1016,7 @@ def wedge(cls, theta1, theta2, n=None):
1016
1016
@lru_cache (8 )
1017
1017
def hatch (hatchpattern , density = 6 ):
1018
1018
"""
1019
- Given a hatch specifier, *hatchpattern*, generates a Path that
1019
+ Given a hatch specifier, *hatchpattern*, generates a ` Path` that
1020
1020
can be used in a repeated hatching pattern. *density* is the
1021
1021
number of lines per unit square.
1022
1022
"""
@@ -1048,7 +1048,7 @@ def get_path_collection_extents(
1048
1048
1049
1049
Parameters
1050
1050
----------
1051
- master_transform : `.Transform`
1051
+ master_transform : `~matplotlib.transforms .Transform`
1052
1052
Global transformation applied to all paths.
1053
1053
paths : list of `Path`
1054
1054
transforms : list of `~matplotlib.transforms.Affine2DBase`
0 commit comments