<divid="unreleased-message"> You are reading an old version of the documentation (v1.4.1). For the latest version see <ahref="/stable/">https://matplotlib.org/stable/</a></div>
<spanid="navigation-toolbar"></span><h1>Interactive navigation<aclass="headerlink" href="#interactive-navigation" title="Permalink to this headline">¶</a></h1>
<dt>The <codeclass="docutils literal"><spanclass="pre">Forward</span></code> and <codeclass="docutils literal"><spanclass="pre">Back</span></code> buttons</dt>
<dd>These are akin to the web browser forward and back buttons. They
are used to navigate back and forth between previously defined
views. They have no meaning unless you have already navigated
somewhere else using the pan and zoom buttons. This is analogous
to trying to click <codeclass="docutils literal"><spanclass="pre">Back</span></code> on your web browser before visiting a
new page –nothing happens. <codeclass="docutils literal"><spanclass="pre">Home</span></code> always takes you to the
first, default view of your data. For <codeclass="docutils literal"><spanclass="pre">Home</span></code>, <codeclass="docutils literal"><spanclass="pre">Forward</span></code> and
<codeclass="docutils literal"><spanclass="pre">Back</span></code>, think web browser where data views are web pages. Use
the pan and zoom to rectangle to define new views.</dd>
<dd>Click this button to launch a file save dialog. You can save
files with the following extensions: <codeclass="docutils literal"><spanclass="pre">png</span></code>, <codeclass="docutils literal"><spanclass="pre">ps</span></code>, <codeclass="docutils literal"><spanclass="pre">eps</span></code>,
<codeclass="docutils literal"><spanclass="pre">svg</span></code> and <codeclass="docutils literal"><spanclass="pre">pdf</span></code>.</dd>
<spanid="key-event-handling"></span><h2>Navigation Keyboard Shortcuts<aclass="headerlink" href="#navigation-keyboard-shortcuts" title="Permalink to this headline">¶</a></h2>
<p>The following table holds all the default keys, which can be overwritten by use of your matplotlibrc (#keymap.*).</p>
<tableborder="1" class="docutils">
<colgroup>
<colwidth="41%" />
<colwidth="59%" />
</colgroup>
<theadvalign="bottom">
<trclass="row-odd"><thclass="head">Command</th>
<thclass="head">Keyboard Shortcut(s)</th>
</tr>
</thead>
<tbodyvalign="top">
<trclass="row-even"><td>Home/Reset</td>
<td><strong>h</strong> or <strong>r</strong> or <strong>home</strong></td>
</tr>
<trclass="row-odd"><td>Back</td>
<td><strong>c</strong> or <strong>left arrow</strong> or <strong>backspace</strong></td>
</tr>
<trclass="row-even"><td>Forward</td>
<td><strong>v</strong> or <strong>right arrow</strong></td>
<td>hold <strong>CONTROL</strong> when panning/zooming with mouse</td>
</tr>
<trclass="row-odd"><td>Toggle grid</td>
<td><strong>g</strong> when mouse is over an axes</td>
</tr>
<trclass="row-even"><td>Toggle x axis scale (log/linear)</td>
<td><strong>L</strong> or <strong>k</strong> when mouse is over an axes</td>
</tr>
<trclass="row-odd"><td>Toggle y axis scale (log/linear)</td>
<td><strong>l</strong> when mouse is over an axes</td>
</tr>
</tbody>
</table>
<p>If you are using <aclass="reference internal" href="../api/pyplot_api.html#module-matplotlib.pyplot" title="matplotlib.pyplot"><codeclass="xref py py-mod docutils literal"><spanclass="pre">matplotlib.pyplot</span></code></a> 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
depends on your UI, but we have examples for every supported UI in the
<codeclass="docutils literal"><spanclass="pre">matplotlib/examples/user_interfaces</span></code> directory. Here is some
<spanclass="n">win</span><spanclass="o">.</span><spanclass="n">set_title</span><spanclass="p">(</span><spanclass="s">"Embedding in GTK"</span><spanclass="p">)</span>
<spanclass="n">canvas</span><spanclass="o">=</span><spanclass="n">FigureCanvas</span><spanclass="p">(</span><spanclass="n">fig</span><spanclass="p">)</span><spanclass="c"># a gtk.DrawingArea</span>