def plot_spectrogram(spec, Xd=(0,1), Yd=(0,1), norm=colo.LogNorm(vmin=0.000001), figname=None):
    #
    x_min, x_max = Xd
    y_min, y_max = Yd
    #
    fig = plt.figure(num=figname)
    nf = len(spec)
    for ch, data in enumerate(spec):
        #print ch, data.shape
        x = np.linspace(x_min, x_max, data.shape[0])
        y = np.linspace(y_min, y_max, data.shape[1])
        #print x[0],x[-1],y[0],y[-1]
        ax = fig.add_subplot(nf*100+11+ch)
        im = NonUniformImage(ax, interpolation='bilinear', cmap=cm.gray_r,
                norm=norm)
        im.set_data(x, y, data.T)
        ax.images.append(im)
        ax.set_xlim(x_min, x_max)
        ax.set_ylim(y_min, y_max)
        ax.set_title('Channel %d' % ch)
        #ax.set_xlabel('timeline')
        ax.set_ylabel('frequency')
        print (data.max(), data.min(), data.mean(), np.median(data)) % 'Statistics: max<%.3f> min<%.3f> mean<%.3f> median<%.3f>'
    #
    plt.show()
dataset/ETHPy150Open dongying/dear/dear/spectrogram.py/plot_spectrogram/swapped operands of `%`