matplotlib.container#
- classmatplotlib.container.BarContainer(*args,**kwargs)[source]#
Bases:
ContainerContainer for the artists of bar plots (e.g. created by
Axes.bar).The container can be treated as a tuple of thepatches themselves.Additionally, you can access these and further parameters by theattributes.
- Attributes:
- patcheslist of
Rectangle The artists of the bars.
- errorbarNone or
ErrorbarContainer A container for the error bar artists if error bars are present.None otherwise.
- datavaluesNone or array-like
The underlying data values corresponding to the bars.
- orientation{'vertical', 'horizontal'}, default: None
If 'vertical', the bars are assumed to be vertical.If 'horizontal', the bars are assumed to be horizontal.
- patcheslist of
- classmatplotlib.container.Container(*args,**kwargs)[source]#
Bases:
tupleBase class for containers.
Containers are classes that collect semantically related Artists such asthe bars of a bar plot.
- add_callback(func)[source]#
Add a callback function that will be called whenever one of the
Artist's properties changes.- Parameters:
- funccallable
The callback function. It must have the signature:
deffunc(artist:Artist)->Any
whereartist is the calling
Artist. Return values may existbut are ignored.
- Returns:
- int
The observer id associated with the callback. This id can beused for removing the callback with
remove_callbacklater.
See also
- pchanged()[source]#
Call all of the registered callbacks.
This function is triggered internally when a property is changed.
See also
- classmatplotlib.container.ErrorbarContainer(*args,**kwargs)[source]#
Bases:
ContainerContainer for the artists of error bars (e.g. created by
Axes.errorbar).The container can be treated as thelines tuple itself.Additionally, you can access these and further parameters by theattributes.
- Attributes:
- linestuple
Tuple of
(data_line,caplines,barlinecols).data_line : A
Line2Dinstance of x, y plot markersand/or line.caplines : A tuple of
Line2Dinstances of the errorbar caps.barlinecols : A tuple of
LineCollectionwith thehorizontal and vertical error ranges.
- has_xerr, has_yerrbool
Trueif the errorbar has x/y errors.
- classmatplotlib.container.StemContainer(*args,**kwargs)[source]#
Bases:
ContainerContainer 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
LineCollection The artists of the vertical lines for all stems.
- baseline
Line2D The artist of the horizontal baseline.
- markerline
- Parameters:
- markerline_stemlines_baselinetuple
Tuple of
(markerline,stemlines,baseline).markerlinecontains theLine2Dof the markers,stemlinesis aLineCollectionof the main lines,baselineis theLine2Dof the baseline.