MATLAB Function Reference
  Go to function:
    Search    Help Desk 
zoom

Zoom in and out on a 2-D plot

Syntax

Description

zoom on turns on interactive zooming. When interactive zooming is enabled in a Figure, pressing a mouse button while your cursor is within an Axes zooms into the point or out from the point beneath the mouse. Zooming changes the Axes limits.

Clicking and dragging over an Axes when interactive zooming is enabled draws a rubber-band box. When the mouse button is released, the Axes zoom in to the region enclosed by the rubber-band box.

Double-clicking over an Axes returns the Axes to its initial zoom setting.

zoom off turns interactive zooming off.

zoom out returns the plot to its initial zoom setting.

zoom reset remembers the current zoom setting as the initial zoom setting. Later calls to zoom out, or double-clicks when interactive zoom mode is enabled, will return to this zoom level.

zoom toggles the interactive zoom status.

zoom xon and zoom yon sets zoom on for the x- and y-axis, respectively.

zoom(factor) zooms in or out by the specified zoom factor, without affecting the interactive zoom mode. Values greater than 1 zoom in by that amount, while numbers greater than 0 and less than 1 zoom out by 1/factor.

zoom(fig, option) Any of the above options can be specified on a figure other than the current figure using this syntax.

Remarks

zoom changes the Axes limits by a factor of two (in or out) each time you press the mouse button while the cursor is within an Axes. You can also click and drag the mouse to define a zoom area, or double-click to return to the initial zoom level.



[ Previous | Help Desk | Next ]