diff --git a/mpl_point_clicker/_clicker.py b/mpl_point_clicker/_clicker.py index a13da66..185832b 100644 --- a/mpl_point_clicker/_clicker.py +++ b/mpl_point_clicker/_clicker.py @@ -103,7 +103,11 @@ def get_positions(self, copy=True): def _on_pick(self, event): # On the pick event, find the original line corresponding to the legend # proxy line, and toggle its visibility. - klass = self._leg_artists[event.artist] + try: + klass = self._leg_artists[event.artist] + except KeyError: + # some pick event not on our legend + return self._current_class = klass self._update_legend_alpha() diff --git a/mpl_point_clicker/_version.py b/mpl_point_clicker/_version.py index 0b070f5..adbef00 100644 --- a/mpl_point_clicker/_version.py +++ b/mpl_point_clicker/_version.py @@ -4,5 +4,5 @@ # Copyright (c) Ian Hunt-Isaak. # Distributed under the terms of the Modified BSD License. -version_info = (0, 1, 3) +version_info = (0, 1, 4) __version__ = ".".join(map(str, version_info))