matplotlib.axes — Matplotlib 3.10.1 documentation (original) (raw)

The Axes class represents one (sub-)plot in a figure. It contains the plotted data, axis ticks, labels, title, legend, etc. Its methods are the main interface for manipulating the plot.

Table of Contents

The Axes class#

Attributes#

Plotting#

Basic#

Spans#

Spectral#

Statistics#

Binned#

Contours#

2D arrays#

Unstructured triangles#

Text and annotations#

Vector fields#

Clearing#

Appearance#

Property cycle#

Axis / limits#

Axis access#

Axis limits and direction#

Axis labels, title, and legend#

Axis scales#

Autoscaling and margins#

Aspect ratio#

Ticks and tick labels#

Units#

Adding artists#

Twinning and sharing#

Axes position#

Async/event based#

Interactive#

Children#

Drawing#

Projection#

Methods used by Axis that must be overridden for non-rectilinear Axes.

Other#

class matplotlib.axes.Axes.ArtistList(axes, prop_name, valid_types=None, invalid_types=None)#

A sublist of Axes children based on their type.

The type-specific children sublists were made immutable in Matplotlib 3.7. In the future these artist lists may be replaced by tuples. Use as if this is a tuple already.

Parameters:

axesAxes

The Axes from which this sublist will pull the children Artists.

prop_namestr

The property name used to access this sublist from the Axes; used to generate deprecation warnings.

valid_typeslist of type, optional

A list of types that determine which children will be returned by this sublist. If specified, then the Artists in the sublist must be instances of any of these types. If unspecified, then any type of Artist is valid (unless limited by_invalid_types_.)

invalid_typestuple, optional

A list of types that determine which children will not be returned by this sublist. If specified, then Artists in the sublist will never be an instance of these types. Otherwise, no types will be excluded.