diff --git a/laydi/view.py b/laydi/view.py index 48924ca..3ddaa8e 100644 --- a/laydi/view.py +++ b/laydi/view.py @@ -695,6 +695,7 @@ class SelectLassoPlotMode(PlotMode): for ax in self.canvas.figure.get_axes(): lasso = Selector(ax, self.plot.lasso_select_callback, select_type='lasso') + self.lasso = lasso self.cids.append(self.canvas.mpl_connect('button_release_event', lasso._onrelease)) self.cids.append(self.canvas.mpl_connect('motion_notify_event', @@ -704,6 +705,7 @@ class SelectLassoPlotMode(PlotMode): def deactivate(self): for cid in self.cids: self.canvas.mpl_disconnect(cid) + self.lasso = None class SelectRectanglePlotMode(PlotMode): @@ -717,6 +719,7 @@ class SelectRectanglePlotMode(PlotMode): for ax in self.canvas.figure.get_axes(): lasso = Selector(ax, self.plot.rectangle_select_callback, select_type='rectangle') + self.lasso = lasso self.cids.append(self.canvas.mpl_connect('button_release_event', lasso._onrelease)) self.cids.append(self.canvas.mpl_connect('motion_notify_event', @@ -726,6 +729,7 @@ class SelectRectanglePlotMode(PlotMode): def deactivate(self): for cid in self.cids: self.canvas.mpl_disconnect(cid) + self.lasso = None class PlotToolbar(gtk.Toolbar):