You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.0.0b1.post7580.dev0+ge487118
matplotlib
Fork me on GitHub

Table Of Contents

Related Topics

This Page

container

matplotlib.container

class matplotlib.container.BarContainer(patches, errorbar=None, **kwargs)

Bases: matplotlib.container.Container

Container for the artists of bar plots (e.g. created by Axes.bar).

The container can be treated as a tuple of the patches themselves. Additionally, you can access these and further parameters by the attributes.

Attributes

patches (list of Rectangle) The artists of the bars.
errorbar (None or ErrorbarContainer) A container for the error bar artists if error bars are present. None otherwise.
class matplotlib.container.Container(kl, label=None)

Bases: tuple

Base class for containers.

Containers are classes that collect semantically related Artists such as the bars of a bar plot.

add_callback(func)

Adds a callback function that will be called whenever one of the Artist’s properties changes.

Returns an id that is useful for removing the callback with remove_callback() later.

get_children()
get_label()

Get the label used for this artist in the legend.

pchanged()

Fire an event when property changed, calling all of the registered callbacks.

remove()
remove_callback(oid)

Remove a callback based on its id.

See also

add_callback()
For adding callbacks
set_label(s)

Set the label to s for auto legend.

ACCEPTS: string or anything printable with ‘%s’ conversion.

set_remove_method(f)
class matplotlib.container.ErrorbarContainer(lines, has_xerr=False, has_yerr=False, **kwargs)

Bases: matplotlib.container.Container

Container for the artists of error bars (e.g. created by Axes.errorbar).

The container can be treated as the lines tuple itself. Additionally, you can access these and further parameters by the attributes.

Attributes

lines (tuple) Tuple of (data_line, caplines, barlinecols). - data_line : Line2D instance of x, y plot markers and/or line. - caplines : tuple of Line2D instances of the error bar caps. - barlinecols : list of LineCollection with the horizontal and vertical error ranges.
has_xerr, has_yerr (bool) True if the errorbar has x/y errors.
class matplotlib.container.StemContainer(markerline_stemlines_baseline, **kwargs)

Bases: matplotlib.container.Container

Container for the artists created in a Axes.stem() plot.

The container can be treated like a namedtuple (markerline, stemlines, baseline).

Attributes

markerline ( Line2D) The artist of the markers at the stem heads.
stemlines (list of Line2D) The artists of the vertical lines for all stems.
baseline (Line2D) The artist of the horizontal baseline.