Participer au site avec un Tip
Rechercher
 

Améliorations / Corrections

Vous avez des améliorations (ou des corrections) à proposer pour ce document : je vous remerçie par avance de m'en faire part, cela m'aide à améliorer le site.

Emplacement :

Description des améliorations :

Module « matplotlib.artist »

Classe « Path »

Informations générales

Héritage

builtins.object
    Path

Définition

class Path(builtins.object):

Description [extrait de Path.__doc__]

    A series of possibly disconnected, possibly closed, line and curve
    segments.

    The underlying storage is made up of two parallel numpy arrays:

    - *vertices*: an Nx2 float array of vertices
    - *codes*: an N-length uint8 array of vertex types, or None

    These two arrays always have the same length in the first
    dimension.  For example, to represent a cubic curve, you must
    provide three vertices as well as three codes ``CURVE3``.

    The code types are:

    - ``STOP``   :  1 vertex (ignored)
        A marker for the end of the entire path (currently not required and
        ignored)

    - ``MOVETO`` :  1 vertex
        Pick up the pen and move to the given vertex.

    - ``LINETO`` :  1 vertex
        Draw a line from the current position to the given vertex.

    - ``CURVE3`` :  1 control point, 1 endpoint
        Draw a quadratic Bezier curve from the current position, with the given
        control point, to the given end point.

    - ``CURVE4`` :  2 control points, 1 endpoint
        Draw a cubic Bezier curve from the current position, with the given
        control points, to the given end point.

    - ``CLOSEPOLY`` : 1 vertex (ignored)
        Draw a line segment to the start point of the current polyline.

    If *codes* is None, it is interpreted as a ``MOVETO`` followed by a series
    of ``LINETO``.

    Users of Path objects should not access the vertices and codes arrays
    directly.  Instead, they should use `iter_segments` or `cleaned` to get the
    vertex/code pairs.  This helps, in particular, to consistently handle the
    case of *codes* being None.

    Some behavior of Path objects can be controlled by rcParams. See the
    rcParams whose keys start with 'path.'.

    .. note::

        The vertices and codes arrays should be treated as
        immutable -- there are a number of optimizations and assumptions
        made up front in the constructor that will not change when the
        data changes.
    

Constructeur(s)

Signature du constructeur Description
__init__(self, vertices, codes=None, _interpolation_steps=1, closed=False, readonly=False)

Liste des attributs statiques

Nom de l'attribut Valeur
CLOSEPOLY79
CURVE33
CURVE44
LINETO2
MOVETO1
NUM_VERTICES_FOR_CODE{0: 1, 1: 1, 2: 1, 3: 2, 4: 3, 79: 1}
STOP0

Liste des propriétés

Nom de la propriétéDescription
codes
readonly
should_simplify
simplify_threshold
vertices

Liste des opérateurs

Opérateurs hérités de la classe object

__eq__, __ge__, __gt__, __le__, __lt__, __ne__

Liste des méthodes

Toutes les méthodes Méthodes d'instance Méthodes statiques Méthodes dépréciées
Signature de la méthodeDescription
__copy__(self)
__deepcopy__(self, memo=None)
__len__(self)
__repr__(self)
arc(theta1, theta2, n=None, is_wedge=False)
circle(center=(0.0, 0.0), radius=1.0, readonly=False)
cleaned(self, transform=None, remove_nans=False, clip=None, quantize=<deprecated parameter>, simplify=False, curves=False, stroke_width=1.0, snap=False, sketch=None)
clip_to_bbox(self, bbox, inside=True)
contains_path(self, path, transform=None)
contains_point(self, point, transform=None, radius=0.0)
contains_points(self, points, transform=None, radius=0.0)
copy(self)
deepcopy(self, memo=None)
get_extents(self, transform=None, **kwargs)
hatch(hatchpattern, density=6)
interpolated(self, steps)
intersects_bbox(self, bbox, filled=True)
intersects_path(self, other, filled=True)
iter_bezier(self, **kwargs)
iter_segments(self, transform=None, remove_nans=True, clip=None, snap=False, stroke_width=1.0, simplify=None, curves=True, sketch=None)
make_compound_path(*args)
make_compound_path_from_polys(XY)
to_polygons(self, transform=None, width=0, height=0, closed_only=True)
transformed(self, transform)
unit_circle()
unit_circle_righthalf()
unit_rectangle()
unit_regular_asterisk(numVertices)
unit_regular_polygon(numVertices)
unit_regular_star(numVertices, innerCircle=0.5)
wedge(theta1, theta2, n=None)

Méthodes héritées de la classe object

__delattr__, __dir__, __format__, __getattribute__, __hash__, __init_subclass__, __reduce__, __reduce_ex__, __setattr__, __sizeof__, __str__, __subclasshook__