librosa.display.cmap(data, robust=True, cmap_seq='magma', cmap_bool='gray_r', cmap_div='coolwarm')[source]

Get a default colormap from the given data.

If the data is boolean, use a black and white colormap.

If the data has both positive and negative values, use a diverging colormap.

Otherwise, use a sequential colormap.


data : np.ndarray

Input data

robust : bool

If True, discard the top and bottom 2% of data when calculating range.

cmap_seq : str

The sequential colormap name

cmap_bool : str

The boolean colormap name

cmap_div : str

The diverging colormap name


cmap : matplotlib.colors.Colormap

The colormap to use for data