matplotlib / matplotlib/matplotlib
[ENH]: Configureable default padding around figure when using constrained_layout
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 23.2k
- Forks
- 8.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 66
Description
### Problem
Constrained layout figures fill out their frames too well, and adding padding during savefig makes the figures no longer adhere to the figsize given in my stylesheet, and isn't a by-default configured amount of padding. When these figures will be used (sometimes two half page-width figures side by side) in my latex document, the contents sit way too close. I don't want to change spacing within the subplot group -- that's all fine, I just want constrained layout to add space around the figure (incl. labels and maybe titles) while respecting the outer figure dimensions.
### Proposed solution
Add padding arguments to rcParams so that they may be configured on a stylesheet. These padding arguments should not influence the spacing of elements within the figure -- only around the figure.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing how constrained layout currently determines spacing around the figure and how rcParams are defined and applied. Establish how configurable outer padding can preserve the requested figsize without changing spacing within the subplot group, then add focused coverage for the proposed behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100