Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

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 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
Apr 17, 2022
Merged

Conversation

greglucas
Copy link
Contributor

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 with self.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

  • [N/A] Has pytest style unit tests (and pytest passes).
  • [N/A] Is Flake 8 compliant (install flake8-docstrings and run flake8 --docstring-convention=all).

Documentation

  • [N/A] New features are documented, with examples if plot related.
  • [N/A] New features have an entry in doc/users/next_whats_new/ (follow instructions in README.rst there).
  • API changes documented in doc/api/next_api_changes/ (follow instructions in README.rst there).
  • [N/A] Documentation is sphinx and numpydoc compliant (the docs should build without error).

@greglucas greglucas added this to the v3.6.0 milestone Apr 9, 2022
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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.
Copy link
Member

Choose a reason for hiding this comment

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

Should this point to canvas.mpl_connect instead?

Copy link
Contributor Author

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 for canvas.callbacks.connect it looks like. I guess mpl_connect is preferred?

This removes callbacks from the figure level. It only allowed the
dpi_changed signal, which is not used anywhere in the library.
@anntzer anntzer merged commit 16f6370 into matplotlib:main Apr 17, 2022
@greglucas greglucas deleted the rm-dpi-changed branch April 18, 2022 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.