FreeMat: VIEW Set Graphical View

FreeMat

- Main Page
- Related Pages

VIEW Set Graphical View

Section: Handle-Based Graphics

# Usage

The `view` function sets the view into the current plot. The simplest form is

      view(n)

where `n=2` sets a standard view (azimuth 0 and elevation 90), and `n=3` sets a standard 3D view (azimuth 37.5 and elevation 30). With two arguments,

      view(az,el)

you set the viewpoint to azimuth `az` and elevation `el`.

# Example

Here is a 3D surface plot shown with a number of viewpoints. First, the default view for a 3D plot.

    --> x = repmat(linspace(-1,1),[100,1]);
    --> y = x';
    --> r = x.^2+y.^2;
    --> z = exp(-r*3).*cos(5*pi*r);
    --> surf(x,y,z);
    --> axis equal
    --> view(3)

Next, we look at it as a 2D plot

    --> surf(x,y,z);
    --> axis equal
    --> view(2)

Finally, we generate a different view of the same surface.

    --> surf(x,y,z);
    --> axis equal
    --> view(25,50);