cycle_changer

cycle_changer(self, func, *args, cycle=None, cycle_kw=None, label=None, labels=None, values=None, legend=None, legend_kw=None, colorbar=None, colorbar_kw=None, **kwargs)[source]

Wraps methods that use the property cycler (plot, scatter, bar, hist, boxplot, violinplot, fill_between, fill_betweenx, pie, stem, and step), 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 and violinplot, 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). If True, the default location is used. Valid locations are described in legend.

  • legend_kw (dict-like, optional) – Ignored if legend is None. Extra keyword args for our call to legend.

  • 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). If True, the default location is used. Valid locations are described in colorbar.

  • colorbar_kw (dict-like, optional) – Ignored if colorbar is None. Extra keyword args for our call to colorbar.

Other Parameters

*args, **kwargs – Passed to the matplotlib plotting method.

See also

None(), None()

Notes

See the matplotlib source. The set_prop_cycle command modifies underlying _get_lines and _get_patches_for_fill.