-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Cleanup psd example. #23426
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
Cleanup psd example. #23426
Conversation
@@ -57,43 +55,35 @@ | |||
y = 10. * np.sin(2 * np.pi * 4 * t) + 5. * np.sin(2 * np.pi * 4.25 * t) | |||
y = y + np.random.randn(*t.shape) | |||
|
|||
# Plot the raw time series | |||
# Plot the raw time series. | |||
fig = plt.figure(constrained_layout=True) | |||
gs = gridspec.GridSpec(2, 3, figure=fig) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is there a point to using gridspec here/would mosaic maybe be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I switched to the more idiomatic add_gridspec, but switching to subplot_mosaic would both result in slightly inconsistent layouts in this subexample relative to all others (unless you make the change in all subexamples) and 2) make the lines below no longer fit in 79 characters. I wouldn't be opposed if you make such a global change across all subexamples of the file, but let's not do this here?
This seems good, but I thought we had a discussion about using |
- Show all figures at once. - Group axes setter calls to have them take less room relative to the psd calls, which are the object of the example. - Align the noverlap examples to make the parallelism between them clearer. - Don't introduce a second random state with a single use.
We are trying to deprecate these, so why are we fixing the example? |
We've been talking about deprecating this for a long time and I don't think that'll happen any time soon (though I'd be happy to be proven wrong) so I think in the meantime fix improvements are still useful (unless we decide to "deprecate by removing from the docs", which may be a valid strategy too...). |
The status is (#20631 (comment)):
Because of the last point, I would currently not activately switch to |
There is a PR to deprecate it... #22920 |
Ah, sorry I missed that. Let's just not bother, then. |
psd calls, which are the object of the example.
clearer.
PR Summary
PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).