From ca8f3e579e42ee313d88e688efdf5518cf73c09f Mon Sep 17 00:00:00 2001 From: Antony Lee Date: Sat, 17 Dec 2022 23:19:44 +0100 Subject: [PATCH] Don't set the never-used Line2D._contains in set_picker. The _contains attribute is never accessed anywhere in the library (since the removal of get/set_contains). Note that this patch intentionally doesn't try to disentangle the much more complex interplay between set_picker and set_pickradius... --- lib/matplotlib/lines.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/lib/matplotlib/lines.py b/lib/matplotlib/lines.py index 8df89373adf1..35c1a1c75628 100644 --- a/lib/matplotlib/lines.py +++ b/lib/matplotlib/lines.py @@ -611,9 +611,7 @@ def set_picker(self, p): p : float or callable[[Artist, Event], tuple[bool, dict]] If a float, it is used as the pick radius in points. """ - if callable(p): - self._contains = p - else: + if not callable(p): self.set_pickradius(p) self._picker = p