| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 9b1fcf6 commit eb13a69
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -20,13 +20,15 @@ more information. | |||
| 20 | 20 | ||
| 21 | 21 | The interactive backends also provide the ability to rotate and zoom the 3D | |
| 22 | 22 | scene. One can rotate the 3D scene by simply clicking-and-dragging the scene. | |
| 23 | - Zooming is done by right-clicking the scene and dragging the mouse up and down | ||
| 24 | - (unlike 2D plots, the toolbar zoom button is not used). | ||
| 23 | + Panning is done by clicking the middle mouse button, and zooming is done by | ||
| 24 | + right-clicking the scene and dragging the mouse up and down. Unlike 2D plots, | ||
| 25 | + the toolbar pan and zoom buttons are not used. | ||
| 25 | 26 | ||
| 26 | 27 | .. toctree:: | |
| 27 | 28 | :maxdepth: 2 | |
| 28 | 29 | ||
| 29 | 30 | mplot3d/faq.rst | |
| 31 | + mplot3d/view_angles.rst | ||
| 30 | 32 | ||
| 31 | 33 | .. note:: | |
| 32 | 34 | `.pyplot` cannot be used to add content to 3D plots, because its function | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,36 @@ | |||
| 1 | + .. _toolkit_mplot3d-view-angles: | ||
| 2 | + | ||
| 3 | + ******************* | ||
| 4 | + mplot3d View Angles | ||
| 5 | + ******************* | ||
| 6 | + | ||
| 7 | + How to define the view angle | ||
| 8 | + ============================ | ||
| 9 | + | ||
| 10 | + The position of the viewport "camera" in a 3D plot is defined by three angles: | ||
| 11 | + elevation, azimuth, and roll. From that position it always points towards the | ||
| 12 | + center of the plot box volume. The angle direction convention is shared with | ||
| 13 | + `PyVista <https://www.pyvista.org/>`_ and MATLAB (though MATLAB lacks a roll | ||
| 14 | + angle). | ||
| 15 | + | ||
| 16 | + .. image:: /_static/mplot3d_view_angles.png | ||
| 17 | + :align: center | ||
| 18 | + | ||
| 19 | + | ||
| 20 | + Rotating the plot using the mouse will control only the azimuth and elevation, | ||
| 21 | + but all three angles can be set programmatically. | ||
| 22 | + | ||
| 23 | + import matplotlib.pyplot as plt | ||
| 24 | + ax = plt.figure().add_subplot(projection='3d') | ||
| 25 | + ax.view_init(elev=30, azim=45, roll=15) | ||
| 26 | + | ||
| 27 | + | ||
| 28 | + Primary view planes | ||
| 29 | + =================== | ||
| 30 | + | ||
| 31 | + To look directly at the primary view planes, the required elevation, azimuth, | ||
| 32 | + and roll angles are shown in the diagram of an "unfolded" plot below. These are | ||
| 33 | + further documented in the `.mplot3d.axes3d.Axes3D.view_init` API. | ||
| 34 | + | ||
| 35 | + .. image:: /_static/mplot3d_primary_view_planes.png | ||
| 36 | + :align: center | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments