Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 030bf3a

Browse files
authored
Merge pull request #25926 from tacaswell/doc/restore_navigation_docs
DOC: restore navigation documentation
2 parents a1f9e0f + 2d2c5ca commit 030bf3a

File tree

1 file changed

+83
-7
lines changed

1 file changed

+83
-7
lines changed

galleries/users_explain/figure/interactive.rst

Lines changed: 83 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -194,25 +194,101 @@ the GUI main loop in some other way.
194194
interactive mode. This may work (depending on the GUI toolkit) but
195195
will likely result in a non-responsive figure.
196196

197-
.. _navigation-toolbar:
197+
198+
.. _default_ui:
198199

199200
Default UI
200201
==========
201202

202-
203203
The windows created by :mod:`~.pyplot` have an interactive toolbar with navigation
204-
buttons and a readout of the data values the cursor is pointing at. A number of
205-
helpful keybindings are registered by default.
204+
buttons and a readout of the data values the cursor is pointing at.
205+
206+
.. _navigation-toolbar:
207+
208+
Interactive navigation
209+
======================
210+
211+
.. image:: ../../../_static/toolbar.png
212+
213+
All figure windows come with a navigation toolbar, which can be used
214+
to navigate through the data set. Here is a description of each of
215+
the buttons at the bottom of the toolbar
216+
217+
.. image:: ../../../../lib/matplotlib/mpl-data/images/home_large.png
218+
219+
.. image:: ../../../../lib/matplotlib/mpl-data/images/back_large.png
220+
221+
.. image:: ../../../../lib/matplotlib/mpl-data/images/forward_large.png
222+
223+
The ``Home``, ``Forward`` and ``Back`` buttons
224+
These are akin to a web browser's home, forward and back controls.
225+
``Forward`` and ``Back`` are used to navigate back and forth between
226+
previously defined views. They have no meaning unless you have already
227+
navigated somewhere else using the pan and zoom buttons. This is analogous
228+
to trying to click ``Back`` on your web browser before visiting a
229+
new page or ``Forward`` before you have gone back to a page --
230+
nothing happens. ``Home`` always takes you to the
231+
first, default view of your data. Again, all of these buttons should
232+
feel very familiar to any user of a web browser.
233+
234+
.. image:: ../../../../lib/matplotlib/mpl-data/images/move_large.png
235+
236+
The ``Pan/Zoom`` button
237+
This button has two modes: pan and zoom. Click the toolbar button
238+
to activate panning and zooming, then put your mouse somewhere
239+
over an axes. Press the left mouse button and hold it to pan the
240+
figure, dragging it to a new position. When you release it, the
241+
data under the point where you pressed will be moved to the point
242+
where you released. If you press 'x' or 'y' while panning the
243+
motion will be constrained to the x or y axis, respectively. Press
244+
the right mouse button to zoom, dragging it to a new position.
245+
The x axis will be zoomed in proportionately to the rightward
246+
movement and zoomed out proportionately to the leftward movement.
247+
The same is true for the y axis and up/down motions. The point under your
248+
mouse when you begin the zoom remains stationary, allowing you to
249+
zoom in or out around that point as much as you wish. You can use the
250+
modifier keys 'x', 'y' or 'CONTROL' to constrain the zoom to the x
251+
axis, the y axis, or aspect ratio preserve, respectively.
252+
253+
With polar plots, the pan and zoom functionality behaves
254+
differently. The radius axis labels can be dragged using the left
255+
mouse button. The radius scale can be zoomed in and out using the
256+
right mouse button.
257+
258+
.. image:: ../../../../lib/matplotlib/mpl-data/images/zoom_to_rect_large.png
259+
260+
The ``Zoom-to-rectangle`` button
261+
Click this toolbar button to activate this mode. Put your mouse somewhere
262+
over an axes and press a mouse button. Define a rectangular region by
263+
dragging the mouse while holding the button to a new location. When using
264+
the left mouse button, the axes view limits will be zoomed to the defined
265+
region. When using the right mouse button, the axes view limits will be
266+
zoomed out, placing the original axes in the defined region.
267+
268+
.. image:: ../../../../lib/matplotlib/mpl-data/images/subplots_large.png
269+
270+
The ``Subplot-configuration`` button
271+
Use this tool to configure the appearance of the subplot:
272+
you can stretch or compress the left, right, top, or bottom
273+
side of the subplot, or the space between the rows or
274+
space between the columns.
275+
276+
.. image:: ../../../../lib/matplotlib/mpl-data/images/filesave_large.png
277+
278+
The ``Save`` button
279+
Click this button to launch a file save dialog. You can save
280+
files with the following extensions: ``png``, ``ps``, ``eps``,
281+
``svg`` and ``pdf``.
206282

207283

208284
.. _key-event-handling:
209285

210286
Navigation keyboard shortcuts
211287
-----------------------------
212288

213-
The following table holds all the default keys, which can be
214-
overwritten by use of your :ref:`matplotlibrc
215-
<customizing>`.
289+
A number of helpful keybindings are registered by default. The following table
290+
holds all the default keys, which can be overwritten by use of your
291+
:ref:`matplotlibrc <customizing>`.
216292

217293
================================== ===============================
218294
Command Default key binding and rcParam

0 commit comments

Comments
 (0)