On this page
matplotlib.colors.Colormap
class matplotlib.colors.Colormap(name, N=256)-
Baseclass for all scalar to RGBA mappings.
Typically Colormap instances are used to convert data values (floats) from the interval
[0, 1]to the RGBA color that the respective Colormap represents. For scaling of data into the[0, 1]interval seematplotlib.colors.Normalize. It is worth noting thatmatplotlib.cm.ScalarMappablesubclasses make heavy use of thisdata->normalize->map-to-colorprocessing chain.Parameters: name : str
The name of the colormap.
N : int
The number of rgb quantization levels.
colorbar_extend = None-
When this colormap exists on a scalar mappable and colorbar_extend is not False, colorbar creation will pick up
colorbar_extendas the default value for theextendkeyword in thematplotlib.colorbar.Colorbarconstructor.
is_gray()
reversed(name=None)-
Make a reversed instance of the Colormap.
Note
Function not implemented for base class.
Parameters: name : str, optional
The name for the reversed colormap. If it’s None the name will be the name of the parent colormap + “_r”.
Notes
See
LinearSegmentedColormap.reversed()andListedColormap.reversed()
set_bad(color='k', alpha=None)-
Set color to be used for masked values.
set_over(color='k', alpha=None)-
Set color to be used for high out-of-range values. Requires norm.clip = False
set_under(color='k', alpha=None)-
Set color to be used for low out-of-range values. Requires norm.clip = False
© 2012–2017 Matplotlib Development Team. All rights reserved.
Licensed under the Matplotlib License Agreement.
http://matplotlib.org/2.1.0/api/_as_gen/matplotlib.colors.Colormap.html