@@ -354,9 +354,10 @@ def __init__(self, napari_viewer, parent=None):
354
354
355
355
def on_doubleclick (self , event ):
356
356
if event .dblclick :
357
- show = list (self ._lines .values ())[0 ].get_visible ()
358
- for l in self ._lines .values ():
359
- l .set_visible (not show )
357
+ show = list (self ._lines .values ())[0 ][0 ].get_visible ()
358
+ for lines in self ._lines .values ():
359
+ for l in lines :
360
+ l .set_visible (not show )
360
361
self ._refresh_canvas (value = self ._n )
361
362
362
363
def _napari_theme_has_light_bg (self ) -> bool :
@@ -406,14 +407,14 @@ def _load_dataframe(self):
406
407
y = self .df .xs ((keypoint , "y" ), axis = 1 , level = ["bodyparts" , "coords" ])
407
408
x = np .arange (len (y ))
408
409
color = points_layer .metadata ["face_color_cycles" ]["label" ][keypoint ]
409
- ( line ,) = self .ax .plot (x , y , color = color , label = keypoint )
410
- self ._lines [keypoint ] = line
410
+ lines = self .ax .plot (x , y , color = color , label = keypoint )
411
+ self ._lines [keypoint ] = lines
411
412
412
413
self ._refresh_canvas (value = self ._n )
413
414
414
415
def _toggle_line_visibility (self , keypoint ):
415
- artist = self ._lines [keypoint ]
416
- artist .set_visible (not artist .get_visible ())
416
+ for artist in self ._lines [keypoint ]:
417
+ artist .set_visible (not artist .get_visible ())
417
418
self ._refresh_canvas (value = self ._n )
418
419
419
420
def _refresh_canvas (self , value ):
0 commit comments