SETASPECT

Purpose:

Sets the aspect ratio (width/height) of the plotting region of a Window.

Syntax:

SETASPECT(win, aspect)

win

-

Optional. A Window. Defaults to the current Window.

aspect

-

A real, the aspect ratio or width/height. A value of 0 indicates automatic mode. A value of -1 indicates the natural size for images

Example:

setaspect(2.0)

 

sets the aspect ratio of the current Window to 2.0. The plotting region adjusts such that the width is twice the length of the height.

Example:

setaspect(W1, 0)

 

sets the aspect ratio of W1 to automatic. The plotting region adjusts such that the area is maximized.

Example:

W1: readimage(gethome + "data\kasha.jpg");scalesoff;setaspect(-1)

 

W1 contains the JPEG image file "kasha.jpg" and the aspect ratio is set to the aspect ratio of the image. If a new image is loaded into W1, the aspect ratio is automatically updated.

Remarks:

If aspect is not specified, the current aspect ratio is returned.

 

The default aspect ratio of all Windows can be set with the DEFAULT_ASPECT configuration parameter. For example,

 

 setconf("default_aspect", "0.5")

 

Sets the default aspect ratio to 0.5 for all new Windows.

 

See Also:

READIMAGE

SETWMARGIN