Let digits toggle axes nav only if they correspond to an existing axes. #12141
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, pressing a (1-9) digit key while the cursor is on an axes
will change whether axes, in general, are responsive to "navigation" UI
(pan/zoom/interactive cursor): if the cursor is over axes m and digit
n is pressed, then axes m will become unresponsive to navigation UI
if m!=n, and become responsive again if m==n.
That's likely not the originally desired behavior: in the patch below, I
think the check
a.in_axes(event)
(which has a FIXME comment...) shouldbe removed...
While this is getting sorted out, in the meantime, this patch changes
the behavior above to not disable axes m if m!=n and n is greater
than the total number of axes (i.e., in a case where n does not
correspond to any valid axes). The use case here is to use "4" and "6"
as navigation keys for an interactive image stack viewer (unfortunately
one can't by default use either left/right or h/l as Matplotlib already
assigns default meanings for these keys).
PR Summary
PR Checklist