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:
- name
Colormap
or str or None, default: None If a
Colormap
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.
- name
- Returns:
- Colormap
Examples usingmatplotlib.pyplot.get_cmap
#
On this page