@@ -56,9 +56,6 @@ class ToolBase(object):
56
56
`name` is used as a label in the toolbar button
57
57
"""
58
58
59
- intoolbar = True
60
- """Add the tool to the toolbar"""
61
-
62
59
cursor = None
63
60
"""Cursor to use when the tool is active"""
64
61
@@ -143,7 +140,6 @@ def toggled(self):
143
140
class ToolQuit (ToolBase ):
144
141
"""Tool to call the figure manager destroy method"""
145
142
146
- intoolbar = False
147
143
description = 'Quit the figure'
148
144
keymap = rcParams ['keymap.quit' ]
149
145
@@ -154,7 +150,6 @@ def trigger(self, event):
154
150
class ToolEnableAllNavigation (ToolBase ):
155
151
"""Tool to enable all axes for navigation interaction"""
156
152
157
- intoolbar = False
158
153
description = 'Enables all axes navigation'
159
154
keymap = rcParams ['keymap.all_axes' ]
160
155
@@ -171,7 +166,6 @@ def trigger(self, event):
171
166
class ToolEnableNavigation (ToolBase ):
172
167
"""Tool to enable a specific axes for navigation interaction"""
173
168
174
- intoolbar = False
175
169
description = 'Enables one axes navigation'
176
170
keymap = (1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 )
177
171
@@ -191,7 +185,6 @@ def trigger(self, event):
191
185
class ToolToggleGrid (ToolBase ):
192
186
"""Tool to toggle the grid of the figure"""
193
187
194
- intoolbar = False
195
188
description = 'Toogle Grid'
196
189
keymap = rcParams ['keymap.grid' ]
197
190
@@ -205,7 +198,6 @@ def trigger(self, event):
205
198
class ToolToggleFullScreen (ToolBase ):
206
199
"""Tool to toggle full screen"""
207
200
208
- intoolbar = False
209
201
description = 'Toogle Fullscreen mode'
210
202
keymap = rcParams ['keymap.fullscreen' ]
211
203
@@ -218,7 +210,6 @@ class ToolToggleYScale(ToolBase):
218
210
219
211
description = 'Toogle Scale Y axis'
220
212
keymap = rcParams ['keymap.yscale' ]
221
- intoolbar = False
222
213
223
214
def trigger (self , event ):
224
215
ax = event .inaxes
@@ -239,7 +230,6 @@ class ToolToggleXScale(ToolBase):
239
230
240
231
description = 'Toogle Scale X axis'
241
232
keymap = rcParams ['keymap.xscale' ]
242
- intoolbar = False
243
233
244
234
def trigger (self , event ):
245
235
ax = event .inaxes
@@ -720,20 +710,12 @@ def _mouse_move(self, event):
720
710
self .navigation .canvas .draw_idle ()
721
711
722
712
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
+
739
721
"""Default tools"""
0 commit comments