问题
I am trying to achieve waterfall graph of wav file. In my attempts I noticed that this is basically a spectogram in 3d (or as close to what I need). I am trying to do this in Python with numpy and matplotlib.
My main problem is I don't know how to change the plot of specgram from matplotlib into a 3d plot.
Sample of my "code":
sample ,data = wavfile.read('file.wav')
F = Figure()
a = F.add_subplot(111,projection='3d')
Spec, t, freq, im = a.specgram(data,Fs=2)
I've got this far and have no clue what to do next. I wanna change already existing plot into 3d. I have no code of changing it to 3d, due to lack of my knowledge.
Is it possible to convert 2d plot to 3d ? If so how ? Am i better off constructing a new plot with data from specgram?
The desired outcome would be something like the following:
Thanks for any replies.来源:https://stackoverflow.com/questions/48598829/how-to-convert-a-spectrogram-to-3d-plot-python