def specshow(data, sr=22050, hop_length=512, x_axis=None, y_axis=None,
             n_xticks=5, n_yticks=5, fmin=None, fmax=None, bins_per_octave=12,
             tmin=16, tmax=240, freq_fmt='Hz', time_fmt=None, **kwargs):

    kwargs.setdefault('aspect', 'auto')
    kwargs.setdefault('origin', 'lower')
    kwargs.setdefault('interpolation', 'nearest')

    if np.issubdtype(data.dtype, np.complex):
        warnings.warn('Trying to display complex-valued input. '
                      'Showing magnitude instead.')
        data = np.abs(data)

    kwargs.setdefault('cmap', cmap(data))

    axes = plt.imshow(data, **kwargs)

    all_params = dict(kwargs=kwargs,
                      sr=sr,
                      fmin=fmin,
                      fmax=fmax,
                      bins_per_octave=bins_per_octave,
                      tmin=tmin,
                      tmax=tmax,
                      hop_length=hop_length,
                      time_fmt=time_fmt,
                      freq_fmt=freq_fmt)

    # Scale and decorate the axes
    __axis(data, n_xticks, x_axis, horiz=True, minor=y_axis, **all_params)
    __axis(data, n_yticks, y_axis, horiz=False, minor=x_axis, **all_params)

    return axes
Display a spectrogram/chromagram/cqt/etc.
dataset/ETHPy150Open bmcfee/librosa/librosa/display.py/specshow