I've created spectrogram from file data
in 2d using the script
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()
And the question is how to create 3d spectrogram?
I tried
spec = plot.figure()
ax = spec.gca(projection='3d')
ax.plot_surface(frequs, bins, Pxx, cmap='plasma')
plot.show()
but it doesn't work.