Commit 838930d
committed
ENH: Scroll to zoom
Implements a minimal version of matplotlib#20317, in particular https://github
.com/matplotlib/pull/20317#issuecomment-2233156558:
When any of the axes manipulation tools is active (pan or zoom tool), a
mouse scroll results in a zoom towards the cursor, keeping aspect ratio.
I've decided to require an active manipulation tool, so that without any
active tool the plot cannot be changed (accidentally) - as before.
For convenience, scroll-to-zoom is allowed with both the zoom and pan
tools. Limiting further feels unnecessarily restrictive.
Zooming is also limited to not having a modifier key pressed. This is
because we might later want to add scroll+modifiers for other operations
. It's better for now not to react to these at all to not introduce
behaviors we later want to change.1 parent a5e1f60 commit 838930d
File tree
2 files changed
+47
-0
lines changed- doc/users/next_whats_new
- lib/matplotlib
2 files changed
+47
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2574 | 2574 | | |
2575 | 2575 | | |
2576 | 2576 | | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
2577 | 2612 | | |
2578 | 2613 | | |
2579 | 2614 | | |
| |||
2653 | 2688 | | |
2654 | 2689 | | |
2655 | 2690 | | |
| 2691 | + | |
2656 | 2692 | | |
2657 | 2693 | | |
2658 | 2694 | | |
2659 | 2695 | | |
2660 | 2696 | | |
| 2697 | + | |
| 2698 | + | |
2661 | 2699 | | |
2662 | 2700 | | |
2663 | 2701 | | |
| |||
0 commit comments