@@ -45,19 +45,20 @@ def trigger(self, *args, **kwargs):
4545
4646
4747class GroupHideTool (ToolToggleBase ):
48- '''Hide lines with a given gid'''
48+ '''Show lines with a given gid'''
4949 default_keymap = 'G'
50- description = 'Hide by gid'
50+ description = 'Show by gid'
51+ default_toggled = True
5152
5253 def __init__ (self , * args , ** kwargs ):
5354 self .gid = kwargs .pop ('gid' )
5455 ToolToggleBase .__init__ (self , * args , ** kwargs )
5556
5657 def enable (self , * args ):
57- self .set_lines_visibility (False )
58+ self .set_lines_visibility (True )
5859
5960 def disable (self , * args ):
60- self .set_lines_visibility (True )
61+ self .set_lines_visibility (False )
6162
6263 def set_lines_visibility (self , state ):
6364 gr_lines = []
@@ -75,7 +76,7 @@ def set_lines_visibility(self, state):
7576
7677# Add the custom tools that we created
7778fig .canvas .manager .toolmanager .add_tool ('List' , ListTools )
78- fig .canvas .manager .toolmanager .add_tool ('Hide ' , GroupHideTool , gid = 'mygroup' )
79+ fig .canvas .manager .toolmanager .add_tool ('Show ' , GroupHideTool , gid = 'mygroup' )
7980
8081
8182# Add an existing tool to new group `foo`.
@@ -87,6 +88,6 @@ def set_lines_visibility(self, state):
8788
8889# To add a custom tool to the toolbar at specific location inside
8990# the navigation group
90- fig .canvas .manager .toolbar .add_tool ('Hide ' , 'navigation' , 1 )
91+ fig .canvas .manager .toolbar .add_tool ('Show ' , 'navigation' , 1 )
9192
9293plt .show ()
0 commit comments