Skip to content

Commit 69294b6

Browse files
authored
Merge pull request #19796 from anntzer/unall
Expire ``keymap.all_axes``-related deprecations.
2 parents a943a73 + 529b814 commit 69294b6

File tree

5 files changed

+3
-59
lines changed

5 files changed

+3
-59
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Keymaps toggling ``Axes.get_navigate`` have been removed
2+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
3+
This includes numeric key events and the ``keymap.all_axes`` rcParam.

lib/matplotlib/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -552,7 +552,6 @@ def gen_candidates():
552552
'animation.avconv_path': ('3.3',),
553553
'animation.avconv_args': ('3.3',),
554554
'animation.html_args': ('3.3',),
555-
'keymap.all_axes': ('3.3',),
556555
'savefig.jpeg_quality': ('3.3',),
557556
'text.latex.preview': ('3.3',),
558557
}

lib/matplotlib/backend_bases.py

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2510,7 +2510,6 @@ def key_press_handler(event, canvas=None, toolbar=None):
25102510
grid_minor_keys = rcParams['keymap.grid_minor']
25112511
toggle_yscale_keys = rcParams['keymap.yscale']
25122512
toggle_xscale_keys = rcParams['keymap.xscale']
2513-
all_keys = dict.__getitem__(rcParams, 'keymap.all_axes')
25142513

25152514
# toggle fullscreen mode ('f', 'ctrl + f')
25162515
if event.key in fullscreen_keys:
@@ -2629,29 +2628,6 @@ def _get_uniform_gridstate(ticks):
26292628
_log.warning(str(exc))
26302629
ax.set_xscale('linear')
26312630
ax.figure.canvas.draw_idle()
2632-
# enable navigation for all axes that contain the event (default key 'a')
2633-
elif event.key in all_keys:
2634-
for a in canvas.figure.get_axes():
2635-
if (event.x is not None and event.y is not None
2636-
and a.in_axes(event)): # FIXME: Why only these?
2637-
_api.warn_deprecated(
2638-
"3.3", message="Toggling axes navigation from the "
2639-
"keyboard is deprecated since %(since)s and will be "
2640-
"removed %(removal)s.")
2641-
a.set_navigate(True)
2642-
# enable navigation only for axes with this index (if such an axes exist,
2643-
# otherwise do nothing)
2644-
elif event.key.isdigit() and event.key != '0':
2645-
n = int(event.key) - 1
2646-
if n < len(canvas.figure.get_axes()):
2647-
for i, a in enumerate(canvas.figure.get_axes()):
2648-
if (event.x is not None and event.y is not None
2649-
and a.in_axes(event)): # FIXME: Why only these?
2650-
_api.warn_deprecated(
2651-
"3.3", message="Toggling axes navigation from the "
2652-
"keyboard is deprecated since %(since)s and will be "
2653-
"removed %(removal)s.")
2654-
a.set_navigate(i == n)
26552631

26562632

26572633
def button_press_handler(event, canvas=None, toolbar=None):

lib/matplotlib/backend_tools.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -362,36 +362,6 @@ def trigger(self, sender, event, data=None):
362362
Gcf.destroy_all()
363363

364364

365-
class _ToolEnableAllNavigation(ToolBase):
366-
"""Tool to enable all axes for toolmanager interaction."""
367-
368-
description = 'Enable all axes toolmanager'
369-
default_keymap = mpl.rcParams['keymap.all_axes']
370-
371-
def trigger(self, sender, event, data=None):
372-
mpl.backend_bases.key_press_handler(event, self.figure.canvas, None)
373-
374-
375-
@_api.deprecated("3.3")
376-
class ToolEnableAllNavigation(_ToolEnableAllNavigation):
377-
pass
378-
379-
380-
class _ToolEnableNavigation(ToolBase):
381-
"""Tool to enable a specific axes for toolmanager interaction."""
382-
383-
description = 'Enable one axes toolmanager'
384-
default_keymap = ('1', '2', '3', '4', '5', '6', '7', '8', '9')
385-
386-
def trigger(self, sender, event, data=None):
387-
mpl.backend_bases.key_press_handler(event, self.figure.canvas, None)
388-
389-
390-
@_api.deprecated("3.3")
391-
class ToolEnableNavigation(_ToolEnableNavigation):
392-
pass
393-
394-
395365
class ToolGrid(ToolBase):
396366
"""Tool to toggle the major grids of the figure."""
397367

@@ -999,8 +969,6 @@ def trigger(self, *args, **kwargs):
999969
'fullscreen': ToolFullScreen,
1000970
'quit': ToolQuit,
1001971
'quit_all': ToolQuitAll,
1002-
'allnav': _ToolEnableAllNavigation,
1003-
'nav': _ToolEnableNavigation,
1004972
'xscale': ToolXScale,
1005973
'yscale': ToolYScale,
1006974
'position': ToolCursorPosition,

lib/matplotlib/rcsetup.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1377,7 +1377,6 @@ def _convert_validator_spec(key, conv):
13771377
"keymap.grid_minor": validate_stringlist,
13781378
"keymap.yscale": validate_stringlist,
13791379
"keymap.xscale": validate_stringlist,
1380-
"keymap.all_axes": validate_stringlist,
13811380
"keymap.help": validate_stringlist,
13821381
"keymap.copy": validate_stringlist,
13831382

@@ -1422,7 +1421,6 @@ def _convert_validator_spec(key, conv):
14221421
"animation.avconv_path": "avconv",
14231422
"animation.avconv_args": [],
14241423
"animation.html_args": [],
1425-
"keymap.all_axes": ["a"],
14261424
"savefig.jpeg_quality": 95,
14271425
"text.latex.preview": False,
14281426
}

0 commit comments

Comments
 (0)