mpl_toolkits.mplot3d.axes3d.Axes3D.view_init#

Axes3D.view_init(elev=None, azim=None, roll=None, vertical_axis='z', share=False)[source]#

Set the elevation and azimuth of the Axes in degrees (not radians).

This can be used to rotate the Axes programmatically.

To look normal to the primary planes, the following elevation and azimuth angles can be used. A roll angle of 0, 90, 180, or 270 deg will rotate these views while keeping the axes at right angles.

view plane

elev

azim

XY

90

-90

XZ

0

-90

YZ

0

0

-XY

-90

90

-XZ

0

90

-YZ

0

180

Parameters:
elevfloat, default: None

The elevation angle in degrees rotates the camera above the plane pierced by the vertical axis, with a positive angle corresponding to a location above that plane. For example, with the default vertical axis of 'z', the elevation defines the angle of the camera location above the x-y plane. If None, then the initial value as specified in the Axes3D constructor is used.

azimfloat, default: None

The azimuthal angle in degrees rotates the camera about the vertical axis, with a positive angle corresponding to a right-handed rotation. For example, with the default vertical axis of 'z', a positive azimuth rotates the camera about the origin from its location along the +x axis towards the +y axis. If None, then the initial value as specified in the Axes3D constructor is used.

rollfloat, default: None

The roll angle in degrees rotates the camera about the viewing axis. A positive angle spins the camera clockwise, causing the scene to rotate counter-clockwise. If None, then the initial value as specified in the Axes3D constructor is used.

vertical_axis{"z", "x", "y"}, default: "z"

The axis to align vertically. azim rotates about this axis.

sharebool, default: False

If True, apply the settings to all Axes with shared views.

Examples using mpl_toolkits.mplot3d.axes3d.Axes3D.view_init#

Plot 2D data on 3D plot

Plot 2D data on 3D plot

3D box surface plot

3D box surface plot

Triangular 3D contour plot

Triangular 3D contour plot

Triangular 3D filled contour plot

Triangular 3D filled contour plot