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

FIX: wspace and hspace in subfigures without layout engine #25960

Merged
merged 1 commit into from Jul 5, 2023

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented May 23, 2023

PR summary

Fixes #25511. As discussed in that issue, sometimes a subfigure may be added on a gridspec that is also used for subplots, and it makes sense that the subplots would have larger wspace and hspace than the subfigures would. So for Figure.add_subfigure and the SubFigure instantiation method, it makes sense to continue ignoring any white space settings on the passed gridspec. This PR therefore only modifies the subfigures method, updating the subfigure positions after instantiation.

PR checklist

@rcomer rcomer added topic: geometry manager LayoutEngine, Constrained layout, Tight layout PR: bugfix Pull requests that fix identified bugs labels May 24, 2023
@rcomer rcomer added this to the v3.7.2 milestone May 24, 2023
@rcomer rcomer added topic: figures and subfigures and removed topic: geometry manager LayoutEngine, Constrained layout, Tight layout labels May 24, 2023
lib/matplotlib/figure.py Outdated Show resolved Hide resolved
lib/matplotlib/tests/test_figure.py Outdated Show resolved Hide resolved
@QuLogic QuLogic requested a review from jklymak June 22, 2023 09:09
@QuLogic QuLogic merged commit e051583 into matplotlib:main Jul 5, 2023
39 checks passed
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 5, 2023
@rcomer rcomer deleted the subfigure-spacing branch July 5, 2023 06:31
meeseeksmachine pushed a commit to meeseeksmachine/matplotlib that referenced this pull request Jul 6, 2023
…t-of-pr-25960-on-v3.7.x

Backport PR matplotlib#25960 on branch v3.7.x (FIX: wspace and hspace in subfigures without layout engine)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: bugfix Pull requests that fix identified bugs topic: figures and subfigures
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: wspace and hspace in subfigures not working
3 participants