Skip to content

Commit 5862d8d

Browse files
committed
ignore non-legend pick events
1 parent 763c90a commit 5862d8d

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

mpl_point_clicker/_clicker.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,11 @@ def get_positions(self, copy=True):
103103
def _on_pick(self, event):
104104
# On the pick event, find the original line corresponding to the legend
105105
# proxy line, and toggle its visibility.
106-
klass = self._leg_artists[event.artist]
106+
try:
107+
klass = self._leg_artists[event.artist]
108+
except KeyError:
109+
# some pick event not on our legend
110+
return
107111
self._current_class = klass
108112
self._update_legend_alpha()
109113

mpl_point_clicker/_version.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
# Copyright (c) Ian Hunt-Isaak.
55
# Distributed under the terms of the Modified BSD License.
66

7-
version_info = (0, 1, 3)
7+
version_info = (0, 1, 4)
88
__version__ = ".".join(map(str, version_info))

0 commit comments

Comments
 (0)