ColormapDatabase

class ColormapDatabase(kwargs)[source]

Bases: ColormapRegistry

Dictionary subclass used to replace the matplotlib colormap registry. See __getitem__ and __setitem__ for details.

Parameters:

kwargs (dict-like) – The source dictionary.

Methods Summary

get_cmap(cmap)

Return a color map specified through cmap.

register(cmap, *[, name, force])

Add the colormap after validating and converting.

register_lazy(name, path, type[, is_default])

Register a colormap to be loaded lazily from a file.

Methods Documentation

get_cmap(cmap)[source]

Return a color map specified through cmap.

Parameters:

cmap (str or Colormap or None) –

  • if a Colormap, return it

  • if a string, look it up in mpl.colormaps

  • if None, return the Colormap defined in rc['image.cmap'] = 'Fire'

Returns:

Colormap

register(cmap, *, name=None, force=False)[source]

Add the colormap after validating and converting.

register_lazy(name, path, type, is_default=False)[source]

Register a colormap to be loaded lazily from a file.