@@ -56,9 +56,6 @@ class ToolBase(object):
5656 `name` is used as a label in the toolbar button
5757 """
5858
59- intoolbar = True
60- """Add the tool to the toolbar"""
61-
6259 cursor = None
6360 """Cursor to use when the tool is active"""
6461
@@ -143,7 +140,6 @@ def toggled(self):
143140class ToolQuit (ToolBase ):
144141 """Tool to call the figure manager destroy method"""
145142
146- intoolbar = False
147143 description = 'Quit the figure'
148144 keymap = rcParams ['keymap.quit' ]
149145
@@ -154,7 +150,6 @@ def trigger(self, event):
154150class ToolEnableAllNavigation (ToolBase ):
155151 """Tool to enable all axes for navigation interaction"""
156152
157- intoolbar = False
158153 description = 'Enables all axes navigation'
159154 keymap = rcParams ['keymap.all_axes' ]
160155
@@ -171,7 +166,6 @@ def trigger(self, event):
171166class ToolEnableNavigation (ToolBase ):
172167 """Tool to enable a specific axes for navigation interaction"""
173168
174- intoolbar = False
175169 description = 'Enables one axes navigation'
176170 keymap = (1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 )
177171
@@ -191,7 +185,6 @@ def trigger(self, event):
191185class ToolToggleGrid (ToolBase ):
192186 """Tool to toggle the grid of the figure"""
193187
194- intoolbar = False
195188 description = 'Toogle Grid'
196189 keymap = rcParams ['keymap.grid' ]
197190
@@ -205,7 +198,6 @@ def trigger(self, event):
205198class ToolToggleFullScreen (ToolBase ):
206199 """Tool to toggle full screen"""
207200
208- intoolbar = False
209201 description = 'Toogle Fullscreen mode'
210202 keymap = rcParams ['keymap.fullscreen' ]
211203
@@ -218,7 +210,6 @@ class ToolToggleYScale(ToolBase):
218210
219211 description = 'Toogle Scale Y axis'
220212 keymap = rcParams ['keymap.yscale' ]
221- intoolbar = False
222213
223214 def trigger (self , event ):
224215 ax = event .inaxes
@@ -239,7 +230,6 @@ class ToolToggleXScale(ToolBase):
239230
240231 description = 'Toogle Scale X axis'
241232 keymap = rcParams ['keymap.xscale' ]
242- intoolbar = False
243233
244234 def trigger (self , event ):
245235 ax = event .inaxes
@@ -720,20 +710,12 @@ def _mouse_move(self, event):
720710 self .navigation .canvas .draw_idle ()
721711
722712
723- tools = (('Grid' , ToolToggleGrid ),
724- ('Fullscreen' , ToolToggleFullScreen ),
725- ('Quit' , ToolQuit ),
726- ('EnableAll' , ToolEnableAllNavigation ),
727- ('EnableOne' , ToolEnableNavigation ),
728- ('XScale' , ToolToggleXScale ),
729- ('YScale' , ToolToggleYScale ),
730- ('Home' , ToolHome ),
731- ('Back' , ToolBack ),
732- ('Forward' , ToolForward ),
733- ('Spacer1' , None ),
734- ('Zoom' , ToolZoom ),
735- ('Pan' , ToolPan ),
736- ('Spacer2' , None ),
737- ('Subplots' , 'ConfigureSubplots' ),
738- ('Save' , 'SaveFigure' ))
713+ tools = {'navigation' : [ToolHome , ToolBack , ToolForward ],
714+ 'zoompan' : [ToolZoom , ToolPan ],
715+ 'layout' : ['ConfigureSubplots' , ],
716+ 'io' : ['SaveFigure' , ],
717+ None : [ToolToggleGrid , ToolToggleFullScreen , ToolQuit ,
718+ ToolEnableAllNavigation , ToolEnableNavigation ,
719+ ToolToggleXScale , ToolToggleYScale ]}
720+
739721"""Default tools"""
0 commit comments