From 0e56f62db9a0186c7557a92ab45be90b363d8a1b Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Thu, 8 Jul 2021 11:52:08 +0200 Subject: [PATCH] Deprecate unused LassoSelector event handlers. These are unused since 61ab6df (and have trivial replacements if someone *really* wants to call them manually, which seems unlikely). --- doc/api/next_api_changes/deprecations/20603-AL.rst | 3 +++ lib/matplotlib/widgets.py | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) create mode 100644 doc/api/next_api_changes/deprecations/20603-AL.rst diff --git a/doc/api/next_api_changes/deprecations/20603-AL.rst b/doc/api/next_api_changes/deprecations/20603-AL.rst new file mode 100644 index 000000000000..d64b4f6c9001 --- /dev/null +++ b/doc/api/next_api_changes/deprecations/20603-AL.rst @@ -0,0 +1,3 @@ +``LassoSelector.onpress`` and ``LassoSelector.onrelease`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +... are deprecated (they are straight aliases for ``press`` and ``release``). diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index e7deb9ad5973..674426448003 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -3061,6 +3061,7 @@ def __init__(self, ax, onselect=None, useblit=True, lineprops=None, self.ax.add_line(self.line) self.artists = [self.line] + @_api.deprecated("3.5", alternative="press") def onpress(self, event): self.press(event) @@ -3068,6 +3069,7 @@ def _press(self, event): self.verts = [self._get_data(event)] self.line.set_visible(True) + @_api.deprecated("3.5", alternative="release") def onrelease(self, event): self.release(event) @@ -3083,9 +3085,7 @@ def _onmove(self, event): if self.verts is None: return self.verts.append(self._get_data(event)) - self.line.set_data(list(zip(*self.verts))) - self.update()