iter_segments(self, transform=None, remove_nans=True, clip=None, snap=False, stroke_width=1.0, simplify=None, curves=True, sketch=None)
Each iteration returns a pair (vertices, code)
, where vertices
is a sequence of 1-3 coordinate pairs, and code
is a Path
code.
Additionally, this method can provide a number of standard cleanups and conversions to the path.
If not None, the given affine transformation will be applied to the path.
Whether to remove all NaNs from the path and skip over them using MOVETO commands.
If not None, must be a four-tuple (x1, y1, x2, y2) defining a rectangle in which to clip the path.
If True, snap all nodes to pixels; if False, don't snap them. If None, snap if the path contains only segments parallel to the x or y axes, and no more than 1024 of them.
The width of the stroke being drawn (used for path snapping).
Whether to simplify the path by removing vertices that do not affect its appearance. If None, use the should_simplify
attribute. See also path.simplify
and path.simplify_threshold
.
If True, curve segments will be returned as curve segments. If False, all curves will be converted to line segments.
If not None, must be a 3-tuple of the form (scale, length, randomness), representing the sketch parameters.
Iterate over all curve segments in the path.
The following pages refer to to this document either explicitly or contain code examples using this.
matplotlib.path.Path.cleaned
matplotlib.path.Path.iter_bezier
matplotlib.path.Path
Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.
Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)
SVG is more flexible but power hungry; and does not scale well to 50 + nodes.
All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them