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]: Incorrect crop after constrained layout with equal aspect ratio and bbox_inches = tight #24133

Closed
Milestone
@konradmarx

Description

@konradmarx

Bug summary

When settingrcParams['figure.constrained_layout.use'] = True andax.set_aspect('equal'), and saving withbbox_inches = 'tight', the resulting figure is cropped incorrectly.

Code for reproduction

importmatplotlibasmplimportmatplotlib.pyplotaspltmpl.rcParams['figure.constrained_layout.use']=Truefig,ax=plt.subplots()ax.plot([0,1])ax.set_xlim(0,1)ax.set_aspect('equal')fig.savefig('test.png',bbox_inches='tight')

Actual outcome

MatplotlibDeprecationWarning: The resize_event function was deprecated in Matplotlib 3.6 and will be removed two minor releases later. Use callbacks.process('resize_event', ResizeEvent(...)) instead.  fig, ax = plt.subplots()

test

Expected outcome

If I leave outmpl.rcParams['figure.constrained_layout.use'] = True, but callsubplots withlayout = 'constrained', the saved figure is as expected:
test

(The deprecation warning is probably the same is in#23921, and appears in both cases.)

Additional information

No response

Operating system

macOS Monterey

Matplotlib Version

3.6.0

Matplotlib Backend

macOSX

Python version

3.10.6

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp