I can plot a spectrogram (in a Jupyter notebook) thus:
fs = 48000
noverlap = (fftFrameSamps*3) // 4
spectrum2d, freqs, timePoints, image = \
plt.specgram( wav, NFFT=fftFrameSamps, Fs=fs, noverlap=noverlap )
plt.show()
However, I am only interested in the 15-20 kHz range. How can I plot only this range?
I can see that the function returns image, so maybe I could convert the image to a matrix and take an appropriate slice from the matrix...?
I can see that the function accepts vmin and vmax but these appear to be undocumented and playing with them doesn't yield a valid result.


vminandvmaxdictate the limits of the colorbar (and are disabled when thenormparameter is used). They are outlined on thematplotlib.pyplot.imshow()page