Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
MNT: Deprecate figure callbacks#22813
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
The figure callbacks property is deprecated. The only signal was | ||
"dpi_changed", which can be replaced by connecting to the "resize_event" | ||
on ``figure.canvas.callbacks`` instead. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Should this point tocanvas.mpl_connect
instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Sure, I updated the doc.canvas.mpl_connect
is simply an alias forcanvas.callbacks.connect
it looks like. I guessmpl_connect
is preferred?
This removes callbacks from the figure level. It only allowed thedpi_changed signal, which is not used anywhere in the library.
PR Summary
This removes callbacks from the figure level. It only allowed the "dpi_changed" signal, which is not used anywhere in the library anymore after#22807
A quick note that
resize_event
is apparently not always emitted on a dpi change, but forcing it withself.canvas.resize_event()
triggers some other test failures, so I'm not sure we want to send that signal within the dpi change routine either. I think this is more of a messaging thing in what do we want to list as an alternative rather than a show-stopper and needing to keep this signal around.PR Checklist
Tests and Styling
pytest
passes).flake8-docstrings
and runflake8 --docstring-convention=all
).Documentation
doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).