Accelerating the pace of engineering and science

# Documentation Center

• Trial Software

# view

Viewpoint specification

view(az,el)
view([az,el])
view([x,y,z])
view(2)
view(3)
view(ax,...)
[az,el] = view

## Description

The position of the viewer (the viewpoint) determines the orientation of the axes. You specify the viewpoint in terms of azimuth and elevation, or by a point in three-dimensional space.

view(az,el) and view([az,el]) set the viewing angle for a three-dimensional plot. The azimuth, az, is the horizontal rotation about the z-axis as measured in degrees from the negative y-axis. Positive values indicate counterclockwise rotation of the viewpoint. el is the vertical elevation of the viewpoint in degrees. Positive values of elevation correspond to moving above the object; negative values correspond to moving below the object.

view([x,y,z]) sets the view direction to the Cartesian coordinates x, y, and z. The magnitude of (x,y,z) is ignored.

view(2) sets the default two-dimensional view, az = 0, el = 90.

view(3) sets the default three-dimensional view, az = –37.5, el = 30.

view(ax,...) uses axes ax instead of the current axes.

[az,el] = view returns the current azimuth and elevation.

## Examples

View the object from directly overhead.

```az = 0;
el = 90;
view(az, el);
```

Set the view along the y-axis, with the x-axis extending horizontally and the z-axis extending vertically in the figure.

```view([0 0]);
```

Rotate the view about the z-axis by 180º.

```az = 180;
el = 90;
view(az, el);
```