I am working with audio using librosa, and I need to plot the spectrogram and waveform in the same display.
My code:
plt.figure(figsize=(14, 9))
plt.figure(1)
plt.subplot(211)
plt.title('Spectrogram')
librosa.display.specshow(stft_db, x_axis='time', y_axis='log')
plt.subplot(212)
plt.title('Audioform')
librosa.display.waveplot(y, sr=sr)
Using this code I get this plot
But I need something like this