You are reading an old version of the documentation (v1.3.1). For the latest version see https://matplotlib.org/stable/
matplotlib

Table Of Contents

Previous topic

Pyplot tutorial

Next topic

Customizing matplotlib

This Page

Interactive navigation

../_images/toolbar.png

All figure windows come with a navigation toolbar, which can be used to navigate through the data set. Here is a description of each of the buttons at the bottom of the toolbar

../_images/home.png ../_images/back.png ../_images/forward.png
The Forward and Back buttons
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 Back on your web browser before visiting a new page –nothing happens. Home always takes you to the first, default view of your data. For Home, Forward and Back, think web browser where data views are web pages. Use the pan and zoom to rectangle to define new views.
../_images/move.png
The Pan/Zoom button

This button has two modes: pan and zoom. Click the toolbar button to activate panning and zooming, then put your mouse somewhere over an axes. Press the left mouse button and hold it to pan the figure, dragging it to a new position. When you release it, the data under the point where you pressed will be moved to the point where you released. If you press ‘x’ or ‘y’ while panning the motion will be constrained to the x or y axis, respectively. Press the right mouse button to zoom, dragging it to a new position. The x axis will be zoomed in proportionate to the rightward movement and zoomed out proportionate to the leftward movement. Ditto for the y axis and up/down motions. The point under your mouse when you begin the zoom remains stationary, allowing you to zoom to an arbitrary point in the figure. You can use the modifier keys ‘x’, ‘y’ or ‘CONTROL’ to constrain the zoom to the x axis, the y axis, or aspect ratio preserve, respectively.

With polar plots, the pan and zoom functionality behaves differently. The radius axis labels can be dragged using the left mouse button. The radius scale can be zoomed in and out using the right mouse button.

../_images/zoom_to_rect.png
The Zoom-to-rectangle button
Click this toolbar button to activate this mode. Put your mouse somewhere over and axes and press the left mouse button. Drag the mouse while holding the button to a new location and release. The axes view limits will be zoomed to the rectangle you have defined. There is also an experimental ‘zoom out to rectangle’ in this mode with the right button, which will place your entire axes in the region defined by the zoom out rectangle.
../_images/subplots.png
The Subplot-configuration button
Use this tool to configure the parameters of the subplot: the left, right, top, bottom, space between the rows and space between the columns.
../_images/filesave.png
The Save button
Click this button to launch a file save dialog. You can save files with the following extensions: png, ps, eps, svg and pdf.