Skip to content
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

Remove print_figure overrides in backend subclasses #25713

Merged
merged 1 commit into from Apr 19, 2023

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Apr 18, 2023

PR Summary

AFAICT, print_figure is only called in savefig, and thus has no relation to backend drawing. We went through a lot of trouble to make savefig self-contained, so if this really had any effect, it would be a bug in it instead. But other backends don't do this override and seem to work fine, so these seem superfluous as well.

After this change, just opening a window in Qt and using the save button did not seem to break anything, nor did running savefig with an interactive window open. I did not test Wx, but given the callers of print_figure, I don't see how it could be different.

Fixes #5234

PR Checklist

Documentation and Tests

  • [n/a] Has pytest style unit tests (and pytest passes)
  • [n/a] Documentation is sphinx and numpydoc compliant (the docs should build without error).
  • [n/a] New plotting related features are documented with examples.

Release Notes

  • [n/a] New features are marked with a .. versionadded:: directive in the docstring and documented in doc/users/next_whats_new/
  • [n/a] API changes are marked with a .. versionchanged:: directive in the docstring and documented in doc/api/next_api_changes/
  • [n/a] Release notes conform with instructions in next_whats_new/README.rst or next_api_changes/README.rst

AFAICT, `print_figure` is only called in `savefig`, and thus has no
relation to backend drawing. We went through a lot of trouble to make
`savefig` self-contained, so if this really had any effect, it would be
a bug in it instead. But other backends don't do this override and seem
to work fine, so these seem superfluous as well.

After this change, just opening a window in Qt and using the save button
did not seem to break anything, nor did running `savefig` with an
interactive window open. I did not test Wx, but given the callers of
`print_figure`, I don't see how it could be different.

Fixes matplotlib#5234
@QuLogic QuLogic added this to the v3.8.0 milestone Apr 18, 2023
@tacaswell
Copy link
Member

Other option would be to change these to draw_idle, but agree that if this is needed here that is a bug better fixed else where.

@tacaswell tacaswell merged commit 1b9abc9 into matplotlib:main Apr 19, 2023
40 of 42 checks passed
@QuLogic QuLogic deleted the no-backend-print_figure branch April 19, 2023 21:49
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.

Unicode with usetex=True and pgf backend
3 participants