File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -147,6 +147,23 @@ def set_positions(self, positions):
147147 self ._positions [k ] = list (v )
148148 self ._observers .process ('pos-set' , self .get_positions ())
149149
150+ def clear_positions (self , classes = None ):
151+ """
152+ Clears all points of classes in *classes*. Either all classes or a list of classes.
153+
154+ Parameters
155+ ----------
156+ classes : list
157+ A list of classes to clear. If None, all classes will be cleared.
158+ """
159+ if classes is None :
160+ classes = list (self ._positions .keys ())
161+
162+ for k in classes :
163+ self ._positions [k ].clear ()
164+
165+ self ._update_points ()
166+
150167 def _on_pick (self , event ):
151168 # On the pick event, find the original line corresponding to the legend
152169 # proxy line, and toggle its visibility.
You can’t perform that action at this time.
0 commit comments