next up previous contents
Next: POINT Image Point Information Up: Image Display Functions Previous: IMAGE Image Display Function   Contents

Subsections

ZOOM Image Zoom Function

Usage

This function changes the zoom factor associated with the currently active image. The generic syntax for its use is

  zoom(x)

where x is the zoom factor to be used. The exact behavior of the zoom factor is as follows:

Example

To demonstrate the use of the zoom function, we create a rectangular image of a Gaussian pulse. We start with a display of the image using the image command, and a zoom of 1.

--> x = linspace(-1,1,300)'*ones(1,600);
--> y = ones(300,1)*linspace(-1,1,600);
--> Z = exp(-(x.^2+y.^2)/0.3);
--> image(Z);
--> zoom(1.0);

8752

At this point, resizing the window accomplishes nothing, as with a zoom factor greater than zero, the size of the image is fixed.

If we change the zoom to another factor larger than 1, we enlarge the image by the specified factor (or shrink it, for zoom factors 0 < x < 1. Here is the same image zoomed out to 60

--> image(Z);
--> zoom(0.6);

8755

Similarly, we can enlarge it to 130

--> image(Z)
--> zoom(1.3);

8758

The ``free'' zoom of x = 0 results in the image being zoomed to fit the window without changing the aspect ratio. The image is zoomed as much as possible in one direction.

--> image(Z);
--> zoom(0);
--> sizefig(200,400);

8761

The case of a negative zoom x < 0 results in the image being scaled arbitrarily. This allows the image aspect ratio to be changed, as in the following example.

--> image(Z);
--> zoom(-1);
--> sizefig(200,400);

8764


next up previous contents
Next: POINT Image Point Information Up: Image Display Functions Previous: IMAGE Image Display Function   Contents
Samit K. Basu 2005-03-16