cycle_changer¶
-
cycle_changer
(self, func, *args, cycle=None, cycle_kw=None, markers=None, linestyles=None, label=None, labels=None, values=None, legend=None, legend_kw=None, colorbar=None, colorbar_kw=None, panel_kw=None, **kwargs)[source]¶ Wraps methods that use the property cycler (
plot
,scatter
,bar
,hist
,boxplot
,violinplot
,fill_between
,fill_betweenx
,pie
,stem
, andstep
), adds features for controlling colors in the property cycler and drawing legends or colorbars in one go.This wrapper also standardizes acceptable input – these methods now all accept 2D arrays holding columns of data, and x-coordinates are always optional. Note this alters the behavior of
boxplot
andviolinplot
, which now compile statistics on columns of data instead of rows.- Parameters
cycle (cycle-spec, optional) – The cycle specifer, passed to the
Cycle
constructor. If the returned list of colors is unchanged from the current axes color cycler, the axes cycle will not be reset to the first position.cycle_kw (dict-like, optional) – Passed to
Cycle
.label (float or str, optional) – The legend label to be used for this plotted element.
labels, values (list of float or list of str, optional) – Used with 2D input arrays. The legend labels or colorbar coordinates for each column in the array. Can be numeric or string, and must match the number of columns in the 2D array.
legend (bool, int, or str, optional) – If not
None
, this is a location specifying where to draw an inset or panel legend from the resulting handle(s). IfTrue
, the default location is used. Valid locations are described inlegend
.legend_kw (dict-like, optional) – Ignored if
legend
isNone
. Extra keyword args for our call tolegend
.colorbar (bool, int, or str, optional) – If not
None
, this is a location specifying where to draw an inset or panel colorbar from the resulting handle(s). IfTrue
, the default location is used. Valid locations are described incolorbar
.colorbar_kw (dict-like, optional) – Ignored if
colorbar
isNone
. Extra keyword args for our call tocolorbar
.panel_kw (dict-like, optional) – Dictionary of keyword arguments passed to
panel
, if you are generating an on-the-fly panel.
- Other Parameters
*args, **kwargs – Passed to the matplotlib plotting method.
Notes
See the matplotlib source. The
set_prop_cycle
command modifies underlying_get_lines
and_get_patches_for_fill
.