Python Matplotlib频谱图2D到3D

时间:2019-12-28 23:54:14

标签: python python-3.x matplotlib spectrogram

我已使用脚本在2d中从文件data创建了频谱图

Pxx, freqs, bins, im = plot.specgram(data, NFFT=524288, Fs=2.5e9, noverlap=65536, cmap='plasma')
plot.colorbar(label='Voltage (dB)').ax.yaxis.set_label_position('left')
ax = plot.gca()
ax.set_title('Night sound spectrogram detection')
ax.set_xlabel('Time (s)')
ax.set_ylabel('Frequency (Hz)')
plot.show()

问题是如何创建3d频谱图?

我尝试过

spec = plot.figure()
ax = spec.gca(projection='3d')

ax.plot_surface(frequs, bins, Pxx, cmap='plasma')
plot.show()

但它不起作用。

0 个答案:

没有答案