Skip to content
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

Avoid gridspec in more examples #23497

Merged
merged 3 commits into from Aug 12, 2022
Merged

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Jul 28, 2022

PR Summary

By using subfigures, the new support for height_ratios/width_ratios directly in subplots, or just using subplots.

PR Checklist

Tests and Styling

  • [n/a] Has pytest style unit tests (and pytest passes).
  • Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [n/a] New features are documented, with examples if plot related.
  • [n/a] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • [n/a] API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • Documentation is sphinx and numpydoc compliant (the docs should build without error).

@QuLogic QuLogic added this to the v3.6.0 milestone Jul 28, 2022
@@ -19,8 +19,8 @@
styles = mpatch.BoxStyle.get_styles()
ncol = 2
nrow = (len(styles) + 1) // ncol
axs = (plt.figure(figsize=(3 * ncol, 1 + nrow))
.add_gridspec(1 + nrow, ncol, wspace=.5).subplots())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fwiw I prefer add_gridspec to gridspec_kw...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know, but I don't see how that improves this example since it's not about add_gridspec.

@QuLogic QuLogic force-pushed the less-gridspec-demo branch 2 times, most recently from 2ee98c8 to c8cd81b Compare July 28, 2022 09:16
@tacaswell
Copy link
Member

This needs a rebase to check that the docs build is clean.

I am a bit torn on this, we should avoid thrashing back and forth. I think for the cases where we have a simple keyword it is better to use that add_gridspec, but I am not sure that (..., **gridspec_kw={...}) is actually clearer or easier to understand than obj.add_gridspec(...)

@QuLogic
Copy link
Member Author

QuLogic commented Aug 10, 2022

I don't feel like advocating for it that much and there are only two files, so I've reverted to add_gridspec where it doesn't have a keyword argument

@QuLogic QuLogic force-pushed the less-gridspec-demo branch 2 times, most recently from cf4bfd0 to 8633e7e Compare August 10, 2022 22:26
@timhoffm timhoffm merged commit 37300c3 into matplotlib:main Aug 12, 2022
@QuLogic QuLogic deleted the less-gridspec-demo branch August 12, 2022 07:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants