ColorDatabase.__getitem__

ColorDatabase.__getitem__(key)[source]

Get a color. Translates grey into gray and supports retrieving colors “on-the-fly” from registered colormaps and color cycles.

  • For a colormap, use e.g. color=('Blues', 0.8). The number is the colormap index, and must be between 0 and 1.

  • For a color cycle, use e.g. color=('colorblind', 2). The number is the color list index.

This works everywhere that colors are used in matplotlib, for example as color, edgecolor', or `facecolor keyword arguments passed to PlotAxes commands.