Matrix data

Syntax: | `CONTOUR { x y } v nctr { min { incr }} CONTOUR\COLOURS colr { x y } v nctr { min { incr }} CONTOUR\INTERPSIZE ntrp { x y } v num { min { incr }} CONTOUR\INTERPSIZE\COLOURS colr ntrp { x y } v num { min { incr }} CONTOUR\SPECIFIC { x y } v lvls CONTOUR\SPECIFIC\COLOURS colr { x y } v lvls CONTOUR\SPECIFIC\INTERPSIZE ntrp { x y } v lvls CONTOUR\SPECIFIC\INTERPSIZE\COLOURS colr ntrp { x y } v lvls`
Qualifiers: | `\SPECIFIC, \INTERPSIZE, \POLAR, \LEGEND, \COLOURS, \PARTIAL, \RESET, \BORDER, \AXES, \COORDINATES, \AREAS, \VOLUMES`
Defaults: | `X=[1;2;3;...], y=[1;2;3;...], \-SPECIFIC, \-INTERPSIZE, \-POLAR, \-LEGEND, \-COLOURS, \-RESET, \-AREAS, \-VOLUMES, \BORDER, \-COORDINATES, \AXES`

Suppose that `v` is a matrix which has n columns and m rows. The vectors `x` and `y` are optional, and if entered, are used for scaling the axes. Each matrix element, `v[i,j]`, is associated with the coordinates `(x[j],y[i])`. The length of `x` must be greater than or equal to n and the length of `y` must be greater than or equal to m.

If `x` and `y` are not entered, `x` defaults to the set `[1;2;3;...;n]`, and `y` defaults to the set `[1;2;3;...;m]`, so that matrix element `m[i,j]` is associated with the coordinates `(j,i)`.

Minimum and maximum contour coordinates

The minimum and maximum x value for each contour are automatically stored in vectors named `CXMIN` and `CXMAX`; the minimum and maximum y value for each contour are automatically stored in vectors named `CYMIN` and `CYMAX`. These vectors are then available to the user for plotting and/or manipulation. Each time the `CONTOUR` command is entered, these vectors are emptied and replaced, so if you wish to keep them, they should be renamed or copied into other vectors.

Volume

If the `\VOLUMES` qualifier is used, the volume contained within each contour is calculated as a percentage of the total volume. The volume percentages are automatically stored in a vector named `CVOLM`. Each time the `CONTOUR` command is entered, this vector is emptied and replaced, so if you wish to keep it, it should be renamed or copied into another vector.

Area

If the `\AREAS` qualifier is used, the area contained within each contour is calculated as a percentage of the total area. The area percentages are automatically stored in a vector named `CAREA`. Each time the `CONTOUR` command is entered, this vector is emptied and replaced, so if you wish to keep it, it should be renamed or copied into another vector.

Area and volume calculation

The areas and volumes are calculated in the following way. Two dimensional, four point linear interpolation is used to calculate a fine mesh overlayed on the matrix, see the figure below. Suppose the matrix has n columns and m rows and the size of the fine mesh is n1 columns by m1 rows. The total area is n1·m1 and the total volume is the sum of the interpolated values. Each point of the fine mesh is tested against the contour levels, and if a mesh point has a value greater than the contour level, a one is binned for the area vector and the mesh point value is binned for the volume vector. Finally, the area and volume vectors are normalized by conversion to percentages.

Interpolating a fine mesh on the contours of a matrix

Interpolation size

Syntax: | `CONTOUR\INTERPSIZE ntrp { x y } v num { min { incr }} CONTOUR\INTERPSIZE\COLOURS colr ntrp { x y } v num { min { incr }} CONTOUR\SPECIFIC\INTERPSIZE ntrp { x y } v lvls CONTOUR\SPECIFIC\INTERPSIZE/COLOURS colr ntrp { x y } v lvls`

Suppose the matrix has n columns and m rows. The total size of the fine mesh, n1 columns by m1 rows, is defined by the following:

`n1 = (n-1)ix + 1`
`m1 = (m-1)iy + 1`

where `ix-1` is the number of interpolation points between matrix points in the x-direction, and `iy-1` is the number of interpolation points between matrix points in the y-direction. The defaults are as below:

ix |
10 | if |  |  | n | < | 20
5 | if | 20 | ≤ | n | < | 50
3 | if | 50 | ≤ | n | < | 100
2 | if | 100 | ≤ | n |  |
iy |
10 | if |  |  | m | < | 20
5 | if | 20 | ≤ | m | < | 50
3 | if | 50 | ≤ | m | < | 100
2 | if | 100 | ≤ | m |  |

To over-ride these defaults, use the `\INTERPSIZE` qualifier, and enter `ntrp` as the first parameter. Both ix and iy will be set to `ntrp`.

Matrix boundary

By default, the boundary of the matrix is outlined within the axes. If this boundary is not desired, use the `\-BORDER` qualifier.

Scattered data
Example