5

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

kaiz.net
  • 1,984
  • 3
  • 23
  • 31
Colin Talbert
  • 454
  • 6
  • 20

1 Answers1

10

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

maupertius
  • 1,518
  • 4
  • 17
  • 30