DADiSP Worksheet Functions > Function Categories > Window Sizing & Layout > SETASPECT
Sets the aspect ratio (width/height) of the plotting region of a Window.
SETASPECT(win, aspect)
win |
- |
Optional. A Window. Defaults to the current Window. |
aspect |
- |
A real, the aspect ratio or |
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.
setaspect(W1, 0)
sets the aspect ratio of W1 to automatic. The plotting region adjusts such that the area is maximized.
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.
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.