Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Bug]: Constrained layout causes two windows to appear instead of one #30012

Closed as not planned
@DominikDeak

Description

@DominikDeak

Bug summary

When calling pyplot.subplots( layout = "constrained" ) after creating a figure causes matplotlib to display two windows instead of one. See minimal code below.

Code for reproduction

#!/usr/bin/env python3

import matplotlib.pyplot as pyplot

figure = pyplot.figure( figsize = ( 6, 4 ) )
pyplot.subplots( layout = "constrained" )
pyplot.show()

Actual outcome

Image

Expected outcome

Image

Additional information

Commenting out the line with pyplot.subplots( layout = "constrained" ) will display only one window as expected.

Operating system

macOS

Matplotlib Version

3.10.1

Matplotlib Backend

macosx

Python version

Python 3.13.2

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions