camlookat

Moves the camera and target so that given objects fill the view.

Category: Graphics > Formatting and Annotation

Syntax

camlookat

Frames the objects in the current axes.

camlookat(obj)

Frames the object or axes obj.

Description

The camera target moves to the center of the objects and the camera is moved along the view direction, keeping the same orientation, until the objects fit. It is handy after changing the camera so much that the plot is out of view.

Input arguments

obj
Handle of a graphics object, or of axes.

Example

Framing a surface

h = surf(peaks(10));
camlookat(h)

In the app, the figure is drawn below the code.

See also

camtarget campos camzoom camdolly