Contents Previous Next Subchapters

Setting Plotting Window Aspect Ratio
Syntax gaspect(ratio)
See Also gaddview , gspace

Description
Sets the proportion of height over width (the aspect ratio) for the current window, where ratio is an integer, real, or double-precision scalar. The largest possible rectangle, with in the graphic window and with the specified aspect ratio, is used for all relative coordinates with in the window (for example, the relative coordinates used by the gaddview function). A ratio greater than 1 sets the rectangle to be taller than it is wide, and a ratio of less than 1 sets the rectangle to be wider than it is tall. A ratio of 1 yields a rectangle with equal width and height. Setting the aspect ratio to 0 allows the rectangle to expand to the size of the full window.

Example
If you enter
     clear
     gaspect(1)
     x = 0. : .1  : 2 * pi
     gplot(x, [sin(x), cos(x)])
O-Matrix will generate a square plot no matter what the shape of the plotting window.