Calculates the optimum aspect ratio for a graph (J. Ollerton & S.A. Harding).
Option
WINDOW = scalar |
Window number; default 1 |
---|
Parameters
Y = variates |
Vertical coordinates |
---|---|
X = variates |
Horizontal coordinates |
ASPECTRATIO = scalars |
Store the calculated aspect ratios |
Description
BANK
calculates the aspect ratio for a graph from the data to be plotted, specified as y and x variates. A window is set up using the FRAME
directive so that the y and x dimensions are in the correct ratio; by default the window used is window 1, but this can be changed using the WINDOW
option. The new window bounds are guaranteed to be within the existing definition; if the new aspect ratio is less than the current value the y upper bound of the window is reduced by an appropriate amount, otherwise the x upper bound is reduced. The aspect ratio can be saved using the parameter ASPECTRATIO
.
Option: WINDOW
.
Parameters: Y
, X
, ASPECTRATIO
.
Method
The aspect ratio is calculated from the X
and Y
variates of data using the Median-absolute-slope algorithm which centres the orientations of the individual line segments on 45 degrees. The specified window is resized to obtain the optimum aspect ratio within the plotting area; the existing axis margin sizes are preserved.
Action with RESTRICT
The Y
and X
variates can be restricted, however this restriction must be identical for both variates. Existing restrictions will not be altered.
References
Cleveland, W.S. (1987). Graphical Perception: The visual decoding of Quantitative Information on graphical displays of data. Journal of the Royal Statistical Society, Series A, 150, 192-229.
Cleveland, W.S. (1993). Visualizing Data. Hobart Press, Summit, New Jersey.
See also
Directive: FRAME
.
Commands for: Graphics.
Example
CAPTION 'BANK example'; STYLE=meta VARIATE Distance,Speed READ Distance,Speed 0.1 10.05 0.2 10.1 0.4 9.1 0.8 7.8 1.0 7.5 1.5 7.0 2.0 6.8 3.0 6.6 5.0 6.4 10.0 6.1 20.0 5.9 25.0 5.75 30.0 5.7 : CALCULATE Distance = LOG10(Distance*1000) PEN 1; SYMBOL=1; METHOD=LINE XAXIS 1; TITLE='Distance (log_10 meters)' YAXIS 1; TITLE='Average Speed' BANK Speed; Distance DGRAPH [TITLE='BANK example';KEYWINDOW=0] Speed; Distance