next up previous contents index
Next: SUBROUTINE SCALG Up: Description of Plotting Previous: SUBROUTINE SAVPL

SUBROUTINE SCALE

 

 SCALE calculates the minimum and a scaled (smoothed) increment from an array of values. The maximum and minimum of the array are computed and the difference is divided by a length parameter. The resulting values are "smoothed" so that numeric labels appear "nice" when labeled at xm and at one inch increments. The smoothed numbers are taken from the set of values 1,2,4,5,8 * 10n that equals or is smaller than the true value. SCALE is useful in determaning the scale factors for LINE. It is used extensively in the MASTER routines. SCALE is not very intelligent and does not always make good choices. SCALE selects xm and dx so that the plotted x values may be computed using the following formula such that if x=xm, xplotted=0 and if x=xlen*dx+xm, xplotted=xlen.

    xplotted = ( x - xm ) / dx
CALL SCALE (x,xlen,n,k,ix,xm,dx)

x     (R): array of data points from which scale is determined
xlen  (R): scale length
n     (I): number of data points in x (n>1)
k     (I): use every first (k=1) value, second (k=2) value, etc.
           normally k=1.
ix    (I): first data point index for x (normally ix=1)
xm    (R): contains smoothed minimum after the call (returned)
dx    (R): contains smoothed increment after call (returned)



David Long
Wed Jun 12 10:34:11 MDT 1996