diff --git a/lib/matplotlib/widgets.py b/lib/matplotlib/widgets.py index dfc0450132c6..35f3eec3e79e 100644 --- a/lib/matplotlib/widgets.py +++ b/lib/matplotlib/widgets.py @@ -4244,7 +4244,7 @@ def onrelease(self, event): self.verts.append((event.xdata, event.ydata)) if len(self.verts) > 2: self.callback(self.verts) - self.ax.lines.remove(self.line) + self.line.remove() self.verts = None self.disconnect_events()