Boxes

Syntax: DENSITY\BOXES { x y } z { p1 p2 { q1 q2 { r }}}
Qualifiers: \PARTIAL, \XPROFILE, \YPROFILE, \BORDER, \AXES, \RESET
Defaults: if z is a matrix: x=[1;2;3;...], y=[1;2;3;...], p1=0, p2=1, q1=0, q2=1, \-PARTIAL, \-XPROFILE, \-YPROFILE, \BORDER, \AXES, \RESET

To obtain the scaled rectangles type of density plot, use the \BOXES qualifier.

Input variables

If z is a vector, the parameters x and y are expected and must be vectors. x and y are assumed to represent a scattered set of points, where z[i] is the altitude corresponding to the location (x[i],y[i]). No internal matrix is interpolated with the scaled rectangle type of density plot. The lengths of the three vectors must be the same. A box is drawn, centred at location (x[i],y[i]) with relative size determined by v[i].

If z is a matrix, the parameters x and y default to [1;2;3;...], but if entered they must be vectors. Each matrix element, z[i,j], is associated with the coordinates (x[j],y[i]). The length of x must be equal to the number of columns of z and the length of y must be equal to the number of rows. The vectors x and y are used for scaling the axes.

Accentuating a range of values

The optional parameters q1 and q2 can be used to accentuate a range of values. If zmax is the maximum value of the data and zmin is the minimum value of the data, the full box size range will be from a minimum of min = q1*(zmax-zmin)+zmin to a maximum of max = q2*(zmax-zmin)+zmin. The default values are: q1 = 0 and q2 = 1.

Delimiting the range of values

The optional parameters p1 and p2 can be used to select a window of values from within the box size range, min to max, as defined above. Suppose that z is the data value at (x,y). A box is drawn at (x,y) if and only if p1 < (z-min)/(max-min) < p2. The default values are: p1 = 0 and p2 = 1.

Box size scale factor

The optional parameter r is a scale factor which controls the size of the boxes. For each box, the width and height is multiplied by r. The default value is: r = 1.

Filled boxes

The boxes can be filled. Use the AREAFILLCOLOR characteristic to change the fill color. By default, there is no fill colour.

Example of a box type density plot with both x and y profiles

 X=[  1;  0;  1;  0;   .2; .3;   .5;  .8]
 Y=[  5;  5;  0;  0;    1;1.5;  2.5;   4]
 Z=[ 10; 10; 10; 10; -100; 10; -100; 500]
 GRID\XYOUT X Y Z M XOUT YOUT
 SET AREAFILLCOLOR RED
 DENSITY\BOXES\XPROFILE\YPROFILE XOUT YOUT M
 

Examples of box type density plots with accentuated and delimited values

 X=[  1;  0;  1;  0;   .2; .3;   .5;  .8]
 Y=[  5;  5;  0;  0;    1;1.5;  2.5;   4]
 Z=[ 10; 10; 10; 10; -100; 10; -100; 500]
 GRID\XYOUT X Y Z M XOUT YOUT
 WINDOW 5
 SET XLABEL `DENSITY\BOXES XOUT YOUT M 0 1 0 1'
 SET XLABELON 1
 DENSITY\BOXES XOUT YOUT M 0 1 0 1
 WINDOW 7
 SET XLABEL `DENSITY/BOXES XOUT YOUT M .5 1 0 1'
 SET XLABELON 1
 DENSITY\BOXES XOUT YOUT M .5 1 0 1
 WINDOW 6
 SET XLABEL `DENSITY\BOXES XOUT YOUT M 0 1 .5 1'
 SET XLABELON 1
 DENSITY\BOXES XOUT YOUT M 0 1 .5 1
 WINDOW 8
 SET XLABEL `DENSITY\BOXES XOUT YOUT M .5 1 .5 1'
 SET XLABELON 1
 DENSITY\BOXES XOUT YOUT M .5 1 .5 1
 

  DIFFUSION