You are reading documentation for the unreleased version of Matplotlib. Try searching for the released version of this page instead?
Version 2.0.0b1.post7580.dev0+ge487118
matplotlib
Fork me on GitHub

Table Of Contents

This Page

matplotlib.pyplot.register_cmap

matplotlib.pyplot.register_cmap(name=None, cmap=None, data=None, lut=None)

Add a colormap to the set recognized by get_cmap().

It can be used in two ways:

register_cmap(name='swirly', cmap=swirly_cmap)

register_cmap(name='choppy', data=choppydata, lut=128)

In the first case, cmap must be a matplotlib.colors.Colormap instance. The name is optional; if absent, the name will be the name attribute of the cmap.

In the second case, the three arguments are passed to the LinearSegmentedColormap initializer, and the resulting colormap is registered.

Examples using matplotlib.pyplot.register_cmap