campos
Gets or sets the camera position of the current axes.
Category: Graphics > Formatting and Annotation
Syntax
campos([x y z])
Sets the camera position, in data coordinates.
pos = campos
Returns the current position.
campos('auto')
Restores the automatic position.
Description
The camera looks from this point toward the camera target, so moving it changes the viewing angle. Together with camtarget, camup and camva, it defines the whole view of a 3-D plot.
Input arguments
[x y z]- Three-element vector.
Output arguments
pos- Row vector with the camera position.
Example
Setting the position
surf(peaks(10))
campos([20 -20 15])
disp(campos)
Output
20 -20 15