Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Closed
Milestone
Description
Bug summary
When I run the code below
compressed.png
andconstrained.png
are (visually) identical, and the axes in the left of each sub-figure are getting smaller and smallertight.png
has all the axes in each sub-figure the same sizes, but those sizes are wrongnone.png
is correct (all the sizes remain unchanged, the sizes are OK) but the axes decorations overlap the plotting area
For your convenience I've uploaded the image files produced by my code.
Thank you in advance — gb
This behaviour was brought to my attention by
https://stackoverflow.com/questions/79614691/why-are-the-subplots-in-the-subfigures-getting-smaller
Code for reproduction
importmatplotlib.pyplotaspltdeftest(layout):fig=plt.figure(figsize=(12,16),layout=layout)figures=fig.subfigures(4,2)forfinfigures.flatten():gs=f.add_gridspec(3,2)foriinrange(3):f.add_subplot(gs[i,0]).plot()f.add_subplot(gs[:,1]).plot()fig.savefig(layout+".png")test("compressed")test("constrained")test("none")test("tight")
Actual outcome
Expected outcome
Something likenone.png
w/o the axes decoration overlapping the plot areas
Additional information
No response
Operating system
Open Suse Tumbleweed
Matplotlib Version
3.10.1
Matplotlib Backend
qtagg
Python version
Python 3.13.3
Jupyter version
No response
Installation
Linux package manager