Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Layout Managers are confused by complex arrangement of sub-figures and gridspec's #30076

Closed
@boffi

Description

@boffi

Bug summary

When I run the code below

  1. compressed.png andconstrained.png are (visually) identical, and the axes in the left of each sub-figure are getting smaller and smaller
  2. tight.png has all the axes in each sub-figure the same sizes, but those sizes are wrong
  3. none.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

Image
Image
Image
Image

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp