You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[ENH]: Zoom in/out on rolling the mouse wheel #28412
As for requirements:
I don't think removing the toolbar Zoom and Pan buttons altogether is opportune:
The UI should work even if you don't know/remember which mouse key or control key combination you have to use to be able to pan or zoom.
We still want to enable/disable manipulations of the plot, since users may have implemented other mouse-interaction interfaces which may otherwise interfere (anntzer).
So I'd suggest we limit the changes to:
only in pan mode and zoom mode
rolling the mouse wheel: zoom in/out, around position of the mouse pointer;
in combination with ctrl, or with shift: zoom only horizontally, or only vertically
I think letting the mouse wheel pan vertically is a mistake (a graph is not text)
leave the mouse click-and-drag for pan and zoom alone for now (unchanged)
in combination with ctrl, or with shift: zoom only horizontally, or only vertically
Are these standard combinations? If not, we should carefully consider which modifiers should which operations.
It seems there are no standard modifiers. (It seems there is even disagreement as to which way of rolling the wheel zooms 'in' vs. 'out'). rcParams are in order. But the use of modifiers generalizes nicely for 3d plots ('alt' for only zooming x axis, 'ctrl' for y, 'shift' for z'; 'ctrl+shift' for zooming in x and y while leaving z fixed, etc.)
Alternatively, when the mouse pointer is over an axis, we could zoom in the corresponding direction only.
Activity
timhoffm commentedon Jun 18, 2024
See #20317 as a proof of concept.
What needs to be done:
Help is welcome.
MischaMegens2 commentedon Jun 18, 2024
And there is also #18159.
MischaMegens2 commentedon Jun 18, 2024
As for requirements:
I don't think removing the toolbar Zoom and Pan buttons altogether is opportune:
So I'd suggest we limit the changes to:
in combination with ctrl, or with shift: zoom only horizontally, or only vertically
timhoffm commentedon Jun 19, 2024
Are these standard combinations? If not, we should carefully consider which modifiers should which operations.
MischaMegens2 commentedon Jun 19, 2024
It seems there are no standard modifiers. (It seems there is even disagreement as to which way of rolling the wheel zooms 'in' vs. 'out'). rcParams are in order. But the use of modifiers generalizes nicely for 3d plots ('alt' for only zooming x axis, 'ctrl' for y, 'shift' for z'; 'ctrl+shift' for zooming in x and y while leaving z fixed, etc.)
Alternatively, when the mouse pointer is over an axis, we could zoom in the corresponding direction only.
Or both functionalities could be provided.
timhoffm commentedon Jul 17, 2024
Minimal proposal: Scroll up/down without modifiers = zoom in/out to the cursor, keeping aspect ratio.
Direction: Consistent with zooming in maps, and browsers (while they additionally need a modifier, the up=magnification relation matches)
Modifiers can be discussed and added later.
MischaMegens2 commentedon Jul 17, 2024
?
timhoffm commentedon Jul 17, 2024
Typo. Both cases interpret scroll-up as magnification