Skip to content

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

Merged
QuLogic merged 1 commit into
matplotlib:mainfrom
rcomer:subfigure-spacing
Jul 5, 2023
Merged

FIX: wspace and hspace in subfigures without layout engine#25960
QuLogic merged 1 commit into
matplotlib:mainfrom
rcomer:subfigure-spacing

Conversation

@rcomer

@rcomer rcomer commented May 23, 2023

Copy link
Copy Markdown
Member

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
Comment thread lib/matplotlib/figure.py Outdated
Comment thread lib/matplotlib/tests/test_figure.py Outdated
@QuLogic
QuLogic requested a review from jklymak June 22, 2023 09:09
@rcomer
rcomer force-pushed the subfigure-spacing branch from e2fa1ae to 5d9c630 Compare June 23, 2023 18:10
@QuLogic
QuLogic merged commit e051583 into matplotlib:main Jul 5, 2023
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