How to programmatically select pan/zoom in pyqt/matplotlib navigation

matplotlib, pyqt4, python

Solution

I had a similar issue and in my case I solved it by using `toolbar.zoom()`:

import pylab

plt.Figure()
thismanager = get_current_fig_manager()
thismanager.toolbar.zoom()

In that case the figure will appear with the zoom tool already selected

Problem

I have a pyqt4 matplotlib application and I would like the figure to start out (default) to the pan zoom mode when the application opens. I can't find any example or clue from the documentation on how to do this programmatically. Also along this same line how would I enable the shortcut keys in my application (http://matplotlib.sourceforge.net/users/navigation_toolbar.html) Thanks for any suggestions. Colin

Original source