diff --git a/lib/matplotlib/axes/_axes.py b/lib/matplotlib/axes/_axes.py index 9037674780e2..9cff2a44d207 100644 --- a/lib/matplotlib/axes/_axes.py +++ b/lib/matplotlib/axes/_axes.py @@ -7629,6 +7629,8 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None, Fc = 0 # same default as in mlab._spectral_helper() if noverlap is None: noverlap = 128 # same default as in mlab.specgram() + if Fs is None: + Fs = 2 # same default as in mlab.specgram() if mode == 'complex': raise ValueError('Cannot plot a complex specgram') diff --git a/lib/matplotlib/mlab.py b/lib/matplotlib/mlab.py index e79d13f2a53e..d0255a9ca263 100644 --- a/lib/matplotlib/mlab.py +++ b/lib/matplotlib/mlab.py @@ -1113,6 +1113,8 @@ def specgram(x, NFFT=None, Fs=None, detrend=None, window=None, noverlap = 128 # default in _spectral_helper() is noverlap = 0 if NFFT is None: NFFT = 256 # same default as in _spectral_helper() + if Fs is None: + Fs = 2 # same default as in _spectral_helper() if len(x) <= NFFT: cbook._warn_external("Only one segment is calculated since parameter " "NFFT (=%d) >= signal length (=%d)." %