8000 fix: moved default Fs value statement · matplotlib/matplotlib@b7df1aa · GitHub
[go: up one dir, main page]

Skip to content

Commit b7df1aa

Browse files
author
Stefan Mitic
committed
fix: moved default Fs value statement
1 parent 428e2ad commit b7df1aa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7617,6 +7617,8 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
76177617
Fc = 0 # same default as in mlab._spectral_helper()
76187618
if noverlap is None:
76197619
noverlap = 128 # same default as in mlab.specgram()
7620+
if Fs is None:
7621+
Fs = 2 # same default as in mlab._spectral_helper()
76207622

76217623
if mode == 'complex':
76227624
raise ValueError('Cannot plot a complex specgram')
@@ -7649,8 +7651,6 @@ def specgram(self, x, NFFT=None, Fs=None, Fc=None, detrend=None,
76497651
Z = np.flipud(Z)
76507652

76517653
if xextent is None:
7652-
if Fs is None:
7653-
Fs = freqs[-1] * 2 # default set in mlab._spectral_helper()
76547654
# padding is needed for first and last segment:
76557655
pad_xextent = (NFFT-noverlap) / Fs / 2
76567656
xextent = np.min(t) - pad_xextent, np.max(t) + pad_xextent

0 commit comments

Comments
 (0)
0