Section: Handle-Based Graphics
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
.
--> 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) --> quit
Next, we look at it as a 2D plot
--> surf(x,y,z); --> axis equal --> view(2) --> quit
Finally, we generate a different view of the same surface.
--> surf(x,y,z); --> axis equal --> view(25,50); --> quit