Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Fix toolmanager x/y scale "togglers".#26580

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

Draft
anntzer wants to merge1 commit intomatplotlib:main
base:main
Choose a base branch
Loading
fromanntzer:txys

Conversation

anntzer
Copy link
Contributor

ToolXScale and ToolYScale actuallycannot be implemented using ToolToggleBase because a single "toggle" flag cannot store the log/linear state ofmultiple axes at once (i.e. the behavior of pressing "l" becomes wrong as soon as there are multiple axes in a given figure). Instead these must be plain tools that inspect the actual scale on the axes before deciding what to do.

In practice, the easiest is to again reuse the classic toolbar implementation, as is already done for ToolGrid and ToolMinorGrid. Factor out that "forward-to-classic-toolbar" implementation into a _ToolForwardingToClassicToolbar base class and use that whereever possible.

As in#16823, providing strict backcompat seems too hard to be worth it.

PR summary

PR checklist

@anntzer
Copy link
ContributorAuthor

Yes, that's much better, thanks for the suggestion.

Copy link
Member

@timhoffmtimhoffm left a comment
edited
Loading

Choose a reason for hiding this comment

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

Optionally, you may think of a class name not containing ClassicToolbar . And modulo CI failures.

@anntzer
Copy link
ContributorAuthor

I actually can't repro the failures locally (tests pass fine) :/ I'll investigate, but do you get them?

@timhoffm
Copy link
Member

Doc warnings are real:

/home/circleci/project/lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolFullScreen:1: WARNING: py:class reference target not found: matplotlib.backend_tools._ToolForwardingToClassicToolbar
/home/circleci/project/lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolGrid:1: WARNING: py:class reference target not found: matplotlib.backend_tools._ToolForwardingToClassicToolbar
/home/circleci/project/lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolMinorGrid:1: WARNING: py:class reference target not found: matplotlib.backend_tools._ToolForwardingToClassicToolbar
/home/circleci/project/lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolQuit:1: WARNING: py:class reference target not found: matplotlib.backend_tools._ToolForwardingToClassicToolbar
/home/circleci/project/lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolQuitAll:1: WARNING: py:class reference target not found: matplotlib.backend_tools._ToolForwardingToClassicToolbar
/home/circleci/project/lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolXScale:1: WARNING: py:class reference target not found: matplotlib.backend_tools._ToolForwardingToClassicToolbar
/home/circleci/project/lib/matplotlib/backend_tools.py:docstring of matplotlib.backend_tools.ToolYScale:1: WARNING: py:class reference target not found: matplotlib.backend_tools._ToolForwardingToClassicToolbar

I'm off-site and cannot run the tests locally right now.

@anntzer
Copy link
ContributorAuthor

(I know about the doc failures, I just need to (pick a better base class name and) rerun sphinx with -Omissing_references_write_json=1)

ToolXScale and ToolYScale actually *cannot* be implemented usingToolToggleBase because a single "toggle" flag cannot store thelog/linear state of *multiple* axes at once (i.e. the behavior ofpressing "l" becomes wrong as soon as there are multiple axes in a givenfigure).  Instead these must be plain tools that inspect the actualscale on the axes before deciding what to do.In practice, the easiest is to again reuse the classic toolbarimplementation, as is already done for ToolGrid and ToolMinorGrid.Factor out that "forward-to-classic-toolbar" implementation into a_ToolForwardingToClassicToolbar base class and use that whereeverpossible.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@anntzer@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp