File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,6 +76,30 @@ The ``Save`` button
7676 ``svg `` and ``pdf ``.
7777
7878
79+ Navigation Keyboard Shortcuts
80+ -----------------------------
81+
82+ ================================== =====================
83+ Command Keyboard Shortcut(s)
84+ ================================== =====================
85+ Home/Reset **h ** or **r ** or **home **
86+ Back **c ** or **left arrow ** or **backspace **
87+ Forward **v ** or **right arrow **
88+ Pan/Zoom **p **
89+ Zoom-to-rect **o **
90+ Save **s **
91+ Toggle fullscreen **f **
92+ ---------------------------------- ---------------------
93+ **Pan/Zoom mode only **
94+ - constrain pan/zoom to x axis hold **x **
95+ - constrain pan/zoom to y axis hold **y **
96+ - preserve aspect ratio hold **CONTROL **
97+ ---------------------------------- ---------------------
98+ **In axes only **
99+ - Toggle grid **g **
100+ - Toggle y axis scale (log/linear) **l **
101+ ================================== =====================
102+
79103If you are using :mod: `matplotlib.pyplot ` the toolbar will be created
80104automatically for every figure. If you are writing your own user
81105interface code, you can add the toolbar as a widget. The exact syntax
Original file line number Diff line number Diff line change @@ -1513,6 +1513,23 @@ def key_press(self, event):
15131513
15141514 if event .key == 'f' :
15151515 self .full_screen_toggle ()
1516+
1517+ # *h*ome or *r*eset mnemonic
1518+ elif event .key == 'h' or event .key == 'r' or event .key == "home" :
1519+ self .canvas .toolbar .home ()
1520+ # c and v to enable left handed quick navigation
1521+ elif event .key == 'left' or event .key == 'c' or event .key == 'backspace' :
1522+ self .canvas .toolbar .back ()
1523+ elif event .key == 'right' or event .key == 'v' :
1524+ self .canvas .toolbar .forward ()
1525+ # *p*an mnemonic
1526+ elif event .key == 'p' :
1527+ self .canvas .toolbar .pan ()
1528+ # z*o*om mnemonic
1529+ elif event .key == 'o' :
1530+ self .canvas .toolbar .zoom ()
1531+ elif event .key == 's' :
1532+ self .canvas .toolbar .save_figure (self .canvas .toolbar )
15161533
15171534 if event .inaxes is None :
15181535 return
You can’t perform that action at this time.
0 commit comments