Navigation

Operators and Keywords

Function List:

C++ API

: zoom
: zoom (factor)
: zoom on
: zoom off
: zoom xon
: zoom yon
: zoom out
: zoom reset
: zoom (hfig, option)

Zoom the current axes object or control the interactive zoom mode of a figure in the GUI.

Given a numeric argument greater than zero, zoom by the given factor. If the zoom factor is greater than one, zoom in on the plot. If the factor is less than one, zoom out. If the zoom factor is a two- or three-element vector, then the elements specify the zoom factors for the x, y, and z axes respectively.

Given the option "on" or "off", set the interactive zoom mode on or off.

With no arguments, toggle the current zoom mode on or off.

Given the option "xon" or "yon", enable zoom mode for the x or y-axis only.

Given the option "out", zoom to the initial zoom setting.

Given the option "reset", store the current zoom setting so that zoom out will return to this zoom level.

If the first argument hfig is a figure, then operate on the given figure rather than the current figure as returned by gcf.

See also: pan, rotate3d.

Demonstration 1

The following code

 clf;
 sombrero ();
 pause (1);
 ## zoom in by a factor of 2
 zoom (2);
 pause (1);
 ## return to original zoom level
 zoom out;
 pause (1);
 ## zoom in by a factor of 2
 zoom (2);
 pause (1);
 ## set this zoom level as the "initial zoom level"
 ## and zoom in some more
 zoom reset;
 zoom (2);
 pause (1);
 ## return to zoom level set by last call to "zoom reset"
 zoom out;

Produces the following figure

Figure 1

Package: octave