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

Skip to content

[Bug]: Main loop integration with IPyhton broken after matplotlib version 3.6.2 #25485

Closed
@dnicolodi

Description

@dnicolodi

Bug summary

After matplotlib release 3.6.2 (I tested releases 3.6.2, 3.7.0, and 3.7.1) the main loop integration with IPython does not work as expected. I use the the %matplotlib IPython magic to install the main loop integration and the %run magic to run a script that creates some figures and calls matplotlib.pyplot.show().

Code for reproduction

import matplotlib.pyplot as plt
plt.figure()
plt.show()

Actual outcome

The figures are shown and the script execution does not terminate till all the figures are closed. Once all the figures created in the script are closed, the execution returns to the IPython prompt and an additional empty figure is displayed.

Expected outcome

The script execution should terminate and the figures should be available for interaction. No extra figure should be created. This is the behavior with matplotlib 3.6.2. Conda does not have a package for matplotlib 3.6.3, thus I haven't tested with that version.

Additional information

No response

Operating system

Windows

Matplotlib Version

3.70, 3.71

Matplotlib Backend

QtAgg

Python version

3.10

Jupyter version

Testd with IPython 8.0 to 8.10

Installation

conda

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions