classmatplotlib.backend_bases.NavigationToolbar2(canvas)[source]
 
Bases: object Base class for the navigation cursor, version 2. Backends must implement a canvas that handles connections for 'button_press_event' and 'button_release_event'. See FigureCanvasBase.mpl_connect() for more information. They must also define  save_figure()

save the current figure  
draw_rubberband() (optional)

draw the zoom to rect "rubberband" rectangle  
set_message() (optional)

display message  
set_history_buttons() (optional)

you can change the history back / forward buttons to indicate disabled / enabled state.   and override __init__ to set up the toolbar -- without forgetting to call the base-class init. Typically, __init__ needs to set up toolbar buttons connected to the home, back, forward, pan, zoom, and save_figure methods and using standard icons in the "images" subdirectory of the data path. That's it, we'll do the rest!   back(*args)[source]
 
Move back up the view lim stack. For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them. 
   configure_subplots(*args)[source]

   drag_pan(event)[source]
 
Callback for dragging in pan/zoom mode. 
   drag_zoom(event)[source]
 
Callback for dragging in zoom mode. 
   draw_rubberband(event, x0, y0, x1, y1)[source]
 
Draw a rectangle rubberband to indicate zoom limits. Note that it is not guaranteed that x0 <= x1 and y0 <= y1. 
   forward(*args)[source]
 
Move forward in the view lim stack. For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them. 
   home(*args)[source]
 
Restore the original view. For convenience of being directly connected as a GUI callback, which often get passed additional parameters, this method accepts arbitrary parameters, but does not use them. 
   mouse_move(event)[source]

   pan(*args)[source]
 
Toggle the pan/zoom tool. Pan with left button, zoom with right. 
   press_pan(event)[source]
 
Callback for mouse button press in pan/zoom mode. 
   press_zoom(event)[source]
 
Callback for mouse button press in zoom to rect mode. 
   push_current()[source]
 
Push the current view limits and position onto the stack. 
   release_pan(event)[source]
 
Callback for mouse button release in pan/zoom mode. 
   release_zoom(event)[source]
 
Callback for mouse button release in zoom to rect mode. 
   remove_rubberband()[source]
 
Remove the rubberband. 
   save_figure(*args)[source]
 
Save the current figure. 
   set_cursor(cursor)[source]
 
[Deprecated] Set the current cursor to one of the Cursors enums values. If required by the backend, this method should trigger an update in the backend event loop after the cursor is set, as this method may be called e.g. before a long-running task during which the GUI is not updated. Notes  Deprecated since version 3.5.  
   set_history_buttons()[source]
 
Enable or disable the back/forward button. 
   set_message(s)[source]
 
Display a message on toolbar or in status bar. 
   toolitems=(('Home', 'Reset original view', 'home', 'home'), ('Back', 'Back to previous view', 'back', 'back'), ('Forward', 'Forward to next view', 'forward', 'forward'), (None, None, None, None), ('Pan', 'Left button pans, Right button zooms\nx/y fixes axis, CTRL fixes aspect', 'move', 'pan'), ('Zoom', 'Zoom to rectangle\nx/y fixes axis', 'zoom_to_rect', 'zoom'), ('Subplots', 'Configure subplots', 'subplots', 'configure_subplots'), (None, None, None, None), ('Save', 'Save the figure', 'filesave', 'save_figure'))

   update()[source]
 
Reset the axes stack. 
   zoom(*args)[source]
 
Toggle zoom to rect mode.