matplotlib 3.5.1

ParametersBackRef
register(self, cmap, *, name=None, force=False)

The colormap name can then be used as a string argument to any cmap parameter in Matplotlib. It is also available in pyplot.get_cmap .

The colormap registry stores a copy of the given colormap, so that future changes to the original colormap instance do not affect the registered colormap. Think of this as the registry taking a snapshot of the colormap at registration.

Parameters

cmap : matplotlib.colors.Colormap

The colormap to register.

name : str, optional

The name for the colormap. If not given, cmap.name is used.

force: bool, default: False :

If False, a ValueError is raised if trying to overwrite an already registered name. True supports overwriting registered colormaps other than the builtin colormaps.

Register a new colormap.

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

matplotlib.cm.ColormapRegistry

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


File: /matplotlib/cm.py#155
type: <class 'function'>
Commit: