librosa.display.cmap¶
- librosa.display.cmap(data, use_sns=True, robust=True)[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 (‘coolwarm’).
Otherwise, use a sequential map: either cubehelix or ‘OrRd’.
Parameters: data : np.ndarray
Input data
use_sns : bool
If True, and seaborn is installed, use cubehelix maps for sequential data
robust : bool
If True, discard the top and bottom 2% of data when calculating range.
Returns: cmap : matplotlib.colors.Colormap
See also
matplotlib.pyplot.colormaps, seaborn.cubehelix_palette