Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minutePC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Call ax.view_init(elev=..., azim=..., roll=...) on the 3D axes to change the camera view. The angles are in degrees: elevation tilts the camera up or down, azimuth moves it around the plot, and roll spins the view around the viewing direction.
Set the view angle in Python
Create a 3D axes, draw the scatter plot on that axes, then set its view with view_init before displaying or saving the figure:
As an Amazon Associate I earn from qualifying purchases.
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_subplot(projection="3d")
ax.scatter(x, y, z)
ax.view_init(elev=25, azim=45)
plt.show()
Here, x, y, and z are your data arrays or sequences. The call affects the specific axes object ax; use the same object for both scatter and view_init. Matplotlib’s Axes3D.view_init API documents the available angles and their behavior.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →What elevation, azimuth, and roll control
- Elevation (
elev): Raises or lowers the camera relative to the horizontal plane. With the default z-axis vertical, a positive elevation looks down from above the x-y plane. - Azimuth (
azim): Moves the camera around the vertical axis. With the default z-axis vertical, positive azimuth rotates from the camera’s +x direction toward +y. - Roll (
roll): Spins the camera around its viewing direction. Positive roll turns the camera clockwise, making the scene appear to rotate counter-clockwise. It is optional for ordinary view adjustments.
Supply angles in degrees, not radians. You can omit an argument when you want to retain its initially specified value. For example, ax.view_init(elev=25, azim=45) leaves roll at its existing setting. The view-angle guide explains the camera controls and interactive rotation.
#1 Best Overall
Use reference angles for top and side views
For the default z-vertical axes, the Matplotlib 3.10.9 API reference lists these settings for views aligned with the main coordinate planes:
| View | Elevation | Azimuth |
|---|---|---|
| XY plane (top) | 90° | −90° |
| XZ plane (side) | 0° | −90° |
| YZ plane (side) | 0° | 0° |
These reference settings come from the Matplotlib 3.10.9 view_init API reference. They are useful starting points when you need to inspect a projection onto a particular coordinate plane.
Rank #2
Choose an angle that reveals the data
There is no universally best camera position. Change elevation and azimuth in small increments and inspect whether the view separates overlapping points, clarifies a planar relationship, or makes depth easier to judge. For example, Matplotlib’s 3D scatter plot example uses ax.view_init(elev=20., azim=-35, roll=0) to make it easier to see that the points lie on the plane y=0. Treat those values as an illustration for that plot, not a general best setting.
Free tools Windows power users keep installed
One-click scans. No signup required.
Rotate the plot interactively
You can also drag a 3D axes with the mouse while exploring a figure. The current stable view-angle guide documents arcball as the default mouse-rotation style and allows changing it through rcParams["axes3d.mouserotationstyle"]. Mouse behavior changed in Matplotlib 3.10: before 3.10, mouse position mapped directly to azimuth and elevation; newer trackball-style behavior can also involve roll. For reproducible figures, record the final angles and set them explicitly with view_init.
Rank #3
Use 3D axes methods for 3D content
Matplotlib’s mplot3d toolkit presents a 3D scene through a 2D projection. Create the 3D axes with fig.add_subplot(projection="3d"), then use its methods such as ax.scatter and ax.view_init. The mplot3d overview notes that pyplot functions for adding plot content are strictly 2D; the explicit 3D axes methods are the controls for a 3D scatter plot.
Quick Recap
Rank #4
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




