-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Parameter Fs initialization missing in Axes.specgram() #9100
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I do not think this is a problem, the default value used is
I am against changing the docstring to say it defaults to |
When I do:
I get an exception:
while when I do:
I get a spectrogram graph. So the effective default value is not 2. |
Very early on in the specgram code is: if NFFT is None:
NFFT = 256 # same default as in mlab.specgram()
if Fc is None:
Fc = 0 # same default as in mlab._spectral_helper()
if noverlap is None:
noverlap = 128 # same default as in mlab.specgram() which misses out setting |
Ah, sorry I was looking at 👍 to moving the default values up into the signature of |
@andreh7 Want to take a shot at this? |
I would go with everything listed in specgram(x, NFFT=256, Fs=2, Fc=0, detrend=mlab.detrend_none,
window=mlab.window_hanning, noverlap=128,
cmap=None, xextent=None, pad_to=None, sides='default',
scale_by_freq=None, mode='default', scale='default',
**kwargs) Exact work:
|
sorry for the late reply, I'm looking into this now. What about the I also see that (at least in the current head d02024e), |
@andreh7 Can you open a PR with that commit? |
I'd suggest that pad_xextent = (NFFT-noverlap) / freq[-1] / 2 ...that way you aren't updating defaults in two places. I find this call strange anyway. I'd have thought: |
@tacaswell I created pr #9221 What about the default values in |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug summary
the docstring of parameter
Fs
ofmatplotlib.pyplot.specgram()
says that the default value is2
but the default value in the function signature isNone
.Code for reproduction
point your browser to https://matplotlib.org/devdocs/api/_as_gen/matplotlib.pyplot.specgram.html or do:
Actual outcome
Expected outcome
Either write
None
in the docstring or make change the default value of Fs to 2.Matplotlib version
Installed with pip in a conda environment.
The text was updated successfully, but these errors were encountered: