matplotlib.pyplot.get_cmap#

matplotlib.pyplot.get_cmap(name=None,lut=None)[source]#

Get a colormap instance, defaulting to rc values ifname is None.

Parameters:
nameColormap or str or None, default: None

If aColormap instance, it will be returned. Otherwise, the name ofa colormap known to Matplotlib, which will be resampled bylut. Thedefault, None, meansrcParams["image.cmap"] (default:'viridis').

lutint or None, default: None

Ifname is not already a Colormap instance andlut is not None, thecolormap will be resampled to havelut entries in the lookup table.

Returns:
Colormap

Examples usingmatplotlib.pyplot.get_cmap#

Image resampling

Image resampling

2D images in 3D

2D images in 3D

Intersecting planes

Intersecting planes

pie(x)

pie(x)