matplotlib.colors.Colormap¶
-
class
matplotlib.colors.
Colormap
(name, N=256)[source]¶ Bases:
object
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.ScalarMappable
subclasses make heavy use of thisdata->normalize->map-to-color
processing chain.Parameters: - namestr
The name of the colormap.
- Nint
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_extend
as the default value for theextend
keyword in thematplotlib.colorbar.Colorbar
constructor.
-
reversed
(self, name=None)[source]¶ Make a reversed instance of the Colormap.
Note
Function not implemented for base class.
Parameters: - namestr, optional
The name for the reversed colormap. If it's None the name will be the name of the parent colormap + "_r".