Skip to content

Do not close figures on backend switch. #26472

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 8, 2023
Merged

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented Aug 8, 2023

Do not close("all") figures on (allowable) backend switches, e.g. between qt5agg and qt5cairo, or qt5agg and notebook.

The NonGuiException message had to change, as the backend returned by get_backend() may no longer match the actual canvas class.

Closes #15913. (Redo of #15918; see also #14471.)

PR summary

PR checklist

Do not `close("all")` figures on (allowable) backend switches, e.g.
between qt5agg and qt5cairo, or qt5agg and notebook.

The NonGuiException message had to change, as the backend returned by
get_backend() may no longer match the actual canvas class.
@tacaswell tacaswell added this to the v3.8.0 milestone Aug 8, 2023
Copy link
Member

@tacaswell tacaswell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm in favor of squeezing this in for 3.8.

It is a super edge-case but would be good to get done.

@ksunden
Copy link
Member

ksunden commented Aug 8, 2023

Test failure is known flaky test (test_blit)

@ksunden ksunden merged commit c5cab93 into matplotlib:main Aug 8, 2023
@anntzer anntzer deleted the nocloseall branch August 8, 2023 22:07
story645 added a commit to story645/matplotlib that referenced this pull request Aug 9, 2023
story645 added a commit to story645/matplotlib that referenced this pull request Aug 9, 2023
Co-authored-by: Kyle Sunden <git@ksunden.space>
story645 added a commit to story645/matplotlib that referenced this pull request Aug 9, 2023
Co-authored-by: Kyle Sunden <git@ksunden.space>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Switching to inline backend closes GUI windows
3 participants