matplotlib 3.5.1

ParametersBackRef
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.

Parameters

transform : None or :class:`~matplotlib.transforms.Transform`

If not None, the given affine transformation will be applied to the path.

remove_nans : bool, optional

Whether to remove all NaNs from the path and skip over them using MOVETO commands.

clip : None or (float, float, float, float), optional

If not None, must be a four-tuple (x1, y1, x2, y2) defining a rectangle in which to clip the path.

snap : None or bool, optional

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.

stroke_width : float, optional

The width of the stroke being drawn (used for path snapping).

simplify : None or bool, optional

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 .

curves : bool, optional

If True, curve segments will be returned as curve segments. If False, all curves will be converted to line segments.

sketch : None or sequence, optional

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.

Examples

See :

Back References

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

Local connectivity graph

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


File: /matplotlib/path.py#346
type: <class 'function'>
Commit: