Submodules module

Colors and color helpers brought in from an alternate library. See

class’flatui’, shuffle=False)[source]

Bases: object

A helper for mapping categorical values to colors on demand.


Returns the current color cycle from matplotlib., colormap=None, color=None)[source]

Resolves the colormap or the color list with the number of colors. See:


num_colors : int or None

the number of colors in the cycle or colormap

colormap : str or None

the colormap used to create the sequence of colors

color : list or None

the list of colors to specifically use with the plot module, n_colors=None)[source]

Return a color palette object with color definition and handling.

Calling this function with palette=None will return the current matplotlib color cycle.

This function can also be used in a with statement to temporarily set the color cycle for a plot or set of plots.


palette : None or str or sequence

Name of a palette or None to return the current palette. If a sequence the input colors are used but possibly cycled.

Available palette names from yellowbrick.colors.palettes are:

  • accent
  • dark
  • paired
  • pastel
  • bold
  • muted
  • colorblind
  • sns_colorblind
  • sns_deep
  • sns_muted
  • sns_pastel
  • sns_bright
  • sns_dark
  • flatui

n_colors : None or int

Number of colors in the palette. If None, the default will depend on how palette is specified. Named palettes default to 6 colors which allow the use of the names “bgrmyck”, though others do have more or less colors; therefore reducing the size of the list can only be done by specifying this parameter. Asking for more colors than exist in the palette will cause it to cycle.



Returns a ColorPalette object, which behaves like a list, but can be used as a context manager and possesses functions to convert colors.

See also


Set the default color cycle for all plots.


Reassign color codes like "b", "g", etc. to colors from one of the yellowbrick palettes.


Resolve a color map or listed sequence of colors.’accent’)[source]

Change how matplotlib color shorthands are interpreted.

Calling this will change how shorthand codes like “b” or “g” are interpreted by matplotlib in subsequent plots.


palette : str

Named yellowbrick palette to use as the source of colors.

See also

Color codes can also be set through the function that sets the matplotlib color cycle. module

Modifies the matplotlib rcParams in order to make yellowbrick more appealing. This has been modified from Seaborn’s in order to alter the matplotlib rc dictionary on the fly.

NOTE: matplotlib 2.0 styles mean we can simply convert this to a stylesheet!’yellowbrick’, font=’sans-serif’, font_scale=1, color_codes=True, rc=None)[source]

Set aesthetic parameters in one step.

Each set of parameters can be set directly or temporarily, see the referenced functions below for more information.


palette : string or sequence

Color palette, see color_palette()

font : string

Font family, see matplotlib font manager.

font_scale : float, optional

Separate scaling factor to independently scale the size of the font elements.

color_codes : bool

If True and palette is a yellowbrick palette, remap the shorthand color codes (e.g. “b”, “g”, “r”, etc.) to the colors from this palette.

rc : dict or None

Dictionary of rc parameter mappings to override the above., rc=None)[source]

Set the aesthetic style of the plots.

This affects things like the color of the axes, whether a grid is enabled by default, and other aesthetic elements.


style : dict, None, or one of {darkgrid, whitegrid, dark, white, ticks}

A dictionary of parameters or the name of a preconfigured set.

rc : dict, optional

Parameter mappings to override the values in the preset seaborn style dictionaries. This only updates parameters that are considered part of the style definition., n_colors=None, color_codes=False)[source]

Set the matplotlib color cycle using a seaborn palette.


palette : yellowbrick color palette | seaborn color palette (with sns_ prepended)

Palette definition. Should be something that color_palette() can process.

n_colors : int

Number of colors in the cycle. The default number of colors will depend on the format of palette, see the color_palette() documentation for more information.

color_codes : bool

If True and palette is a seaborn palette, remap the shorthand color codes (e.g. “b”, “g”, “r”, etc.) to the colors from this palette.[source]

Restore all RC params to default settings.[source]

Restore all RC params to original settings (respects custom rc).