-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Force origin='upper' in pyplot.specgram #17897
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
Conversation
Specify origin='upper' in call to imshow within specgram to override rcparams setting for origin without changing rcparams itself. Delete origin from kwargs so there are not two occurrences of the origin parameter in the call to imshow (this also means the origin kwarg cannot be changed by the caller).
Please also update the API change note for not supporting 'origin' (instead of ignoring it). |
This ensures the origin kwarg is not silently ignored if passed to pyplot.specgram.
The function pyplot.specgram should raise a TypeError if origin is passed as a keyword argument.
Co-authored-by: Tim Hoffmann <[email protected]>
This note referenced the call to imshow inside of specgram, which might confuse users who do not know the implementation of specgram.
Passing origin as a keyword argument should raise a type error, so test_specgram_origin_kwarg should raise an exception. Therefore, raises is a more precise check than xfail.
The commit 77a2b67 shouldn't be here; I'm not sure how you got it. We can squash merge or you can rebase it out. Please ask in our gitter if you are having any trouble with this. |
Co-authored-by: Tim Hoffmann <[email protected]>
This note referenced the call to imshow inside of specgram, which might confuse users who do not know the implementation of specgram.
Passing origin as a keyword argument should raise a type error, so test_specgram_origin_kwarg should raise an exception. Therefore, raises is a more precise check than xfail.
Note, when you rebase, don't follow git's advice on push; that just creates duplicated commits, new from the rebase and old from the server. You do not want to pull the old commits that are already on GitHub, but throw them away. To do that, use |
I see. Is there a way I can fix that now, or should I leave the duplicate commits? Maybe it would be cleaner to squash merge after all. :) |
Yes, that could be done ( |
Thanks @kate-perkins and @thedorathanasiadis! |
Thank you to everybody who reviewed this PR! |
PR Summary
Fix #17878
In
pyplot.specgram
, theorigin
kwarg is popped. Theorigin
is explicitly set to 'upper'in the call to
imshow
insidepyplot.specgram
. Test added to check that changing theimage.origin
rcParam and theorigin
kwarg to 'lower' does not change the spectrogram.Documentation updated with note that
image.origin
rcParam andorigin
kwarg are ignored.PR Checklist