Revision: 6291
          http://matplotlib.svn.sourceforge.net/matplotlib/?rev=6291&view=rev
Author:   jdh2358
Date:     2008-10-22 02:02:22 +0000 (Wed, 22 Oct 2008)

Log Message:
-----------
applied Pauls keybinding patch

Modified Paths:
--------------
    trunk/matplotlib/doc/users/navigation_toolbar.rst
    trunk/matplotlib/lib/matplotlib/backend_bases.py

Modified: trunk/matplotlib/doc/users/navigation_toolbar.rst
===================================================================
--- trunk/matplotlib/doc/users/navigation_toolbar.rst   2008-10-22 01:24:18 UTC 
(rev 6290)
+++ trunk/matplotlib/doc/users/navigation_toolbar.rst   2008-10-22 02:02:22 UTC 
(rev 6291)
@@ -76,6 +76,30 @@
     ``svg`` and ``pdf``.
 
 
+Navigation Keyboard Shortcuts
+-----------------------------
+
+================================== =====================
+Command                            Keyboard Shortcut(s)
+================================== =====================
+Home/Reset                         **h** or **r** or **home**
+Back                               **c** or **left arrow** or **backspace**
+Forward                            **v** or **right arrow** 
+Pan/Zoom                           **p**                                       
 
+Zoom-to-rect                       **o**                   
+Save                               **s**                   
+Toggle fullscreen                  **f**
+---------------------------------- ---------------------
+**Pan/Zoom mode only**             
+- constrain pan/zoom to x axis     hold **x**
+- constrain pan/zoom to y axis     hold **y**
+- preserve aspect ratio            hold **CONTROL**     
+---------------------------------- ---------------------
+**In axes only**
+- Toggle grid                      **g**
+- Toggle y axis scale (log/linear) **l**
+================================== =====================
+
 If you are using :mod:`matplotlib.pyplot` the toolbar will be created
 automatically for every figure.  If you are writing your own user
 interface code, you can add the toolbar as a widget.  The exact syntax

Modified: trunk/matplotlib/lib/matplotlib/backend_bases.py
===================================================================
--- trunk/matplotlib/lib/matplotlib/backend_bases.py    2008-10-22 01:24:18 UTC 
(rev 6290)
+++ trunk/matplotlib/lib/matplotlib/backend_bases.py    2008-10-22 02:02:22 UTC 
(rev 6291)
@@ -1513,6 +1513,23 @@
 
         if event.key == 'f':
             self.full_screen_toggle()
+        
+        # *h*ome or *r*eset mnemonic
+        elif event.key == 'h' or event.key == 'r' or event.key == "home":
+            self.canvas.toolbar.home()
+        # c and v to enable left handed quick navigation
+        elif event.key == 'left' or event.key == 'c' or event.key == 
'backspace':
+            self.canvas.toolbar.back()
+        elif event.key == 'right' or event.key == 'v':
+            self.canvas.toolbar.forward()
+        # *p*an mnemonic
+        elif event.key == 'p':
+            self.canvas.toolbar.pan()
+        # z*o*om mnemonic
+        elif event.key == 'o':
+            self.canvas.toolbar.zoom()
+        elif event.key == 's':
+            self.canvas.toolbar.save_figure(self.canvas.toolbar)
 
         if event.inaxes is None:
             return


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Matplotlib-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-checkins

Reply via email to