Fix configure_subplots with tool manager by QuLogic · Pull Request #22743 · matplotlib/matplotlib · GitHub
Skip to content

Fix configure_subplots with tool manager - #22743

Merged
oscargus merged 1 commit into
matplotlib:mainfrom
QuLogic:fix-toolmanager-subplottool
Mar 31, 2022
Merged

oscargus merged 1 commit into
matplotlib:mainfrom
QuLogic:fix-toolmanager-subplottool

Conversation

@QuLogic

@QuLogic QuLogic commented Mar 31, 2022

Copy link
Copy Markdown
Member

PR Summary

configure_subplots requires a) an object from which it can get the
canvas property, and b) somewhere it can store its handle for re-use.

The pseudo-toolbar that is used for most Tool classes is temporary and
does not provide the latter. However, tools inherit from ToolBase
which contains a canvas property and they exist for the lifetime of
the toolbar, so can be used instead.

Fixes #22088

PR Checklist

Tests and Styling

  • [n/a] Has pytest style unit tests (and pytest passes).
  • 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).
  • [n/a] 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).

`configure_subplots` requires a) an object from which it can get the
`canvas` property, and b) somewhere it can store its handle for re-use.

The pseudo-toolbar that is used for most `Tool` classes is temporary and
does not provide the latter. However, tools inherit from `ToolBase`
which contains a `canvas` property and they exist for the lifetime of
the toolbar, so can be used instead.

Fixes matplotlib#22088
@QuLogic QuLogic added the MEP: MEP22 tool manager label Mar 31, 2022
@QuLogic QuLogic added this to the v3.5.2 milestone Mar 31, 2022
@oscargus
oscargus merged commit 88faae0 into matplotlib:main Mar 31, 2022
@lumberbot-app

lumberbot-app Bot commented Mar 31, 2022

Copy link
Copy Markdown

@QuLogic
QuLogic deleted the fix-toolmanager-subplottool branch March 31, 2022 22:22
QuLogic pushed a commit to QuLogic/matplotlib that referenced this pull request Mar 31, 2022
oscargus added a commit that referenced this pull request Apr 1, 2022
…3.5.x

Backport PR #22743: Fix configure_subplots with tool manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

MEP: MEP22 tool manager

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Tool Manager example broken

3 participants