view

Sets the viewpoint for the current axes.

Syntax

view(2)

view(3)

view(azimuth, elevation)

view([azimuth, elevation])

view([x, y, z])

view(hAxes, ...)

Inputs

azimuth, elevation
Spherical coordinates used to set the viewpoint. Azimuth is measured from the negative y axis to the positive x axis. Elevation is measured from the x-y plane to positive z axis.
Type: double
Dimension: scalar
x, y, z
Cartesian coordinates used to set the viewpoint.
Type: double
Dimension: scalar
hAxes
Axis handle.
Type: double
Dimension: scalar

Comments

view(2) sets the viewpoint at the positive z axis, which is the default viewpoint for a 2D plot.

view(3) sets the viewpoint at [azimuth = -45, elevation = 30], which is the default viewpoint of a 3D plot.