堆栈谱图Python

时间:2013-11-18 21:21:33

标签: python matplotlib spectrogram

我正在尝试堆叠2个频谱图,但我无法看到堆叠的频谱图。 这是我的代码:

Pxx1, freqs, bins, im = specgram(test_data, NFFT=NFFT, Fs=Fs, noverlap=900, cmap=cm.gist_heat)
Pxx2, freqs, bins, im = specgram(test_datb, NFFT=NFFT, Fs=Fs, noverlap=900, cmap=cm.gist_heat)
x = concatenate((Pxx1,Pxx2),axis=1)
ha = plt.subplot(111)
ha.pcolormesh(bins, freqs, x)
plt.show()

我看到的错误:

Traceback (most recent call last):
  File "CreateDB.py", line 126, in <module>
    ha.pcolormesh(bins, freqs, 10 * np.log10(x))
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes.py", line 7734, in pcolormesh
    X, Y, C = self._pcolorargs('pcolormesh', *args, allmatch=allmatch)
  File "/usr/local/lib/python2.7/dist-packages/matplotlib/axes.py", line 7376, in _pcolorargs
    C.shape, Nx, Ny, funcname))
TypeError: Dimensions of C (513, 1436) are incompatible with X (718) and/or Y (513); see help(pcolormesh)

提前致谢!

0 个答案:

没有答案