C-PLOT

Scientific Graphics and Data Analysis

contour.4

contour generating user function

SYNOPSIS

fn contour.4 [ options ]

DESCRIPTION

The contour.4 user function use the current data to generate new data in the form of contours. Valid options are:

.         Use same options as last time
+g or -g  Data are (or aren't) a perfect grid
+n or -n  Data are (or aren't) a near grid
+s or -s  Data are (or aren't) properly sorted
+r or -r  Reuse (or don't) previous data
+v or -v  Show (or don't) function progress
#         Number of contour intervals (default 10)
zmin=#    Z value of first contour
zmax=#    Z value of last contour
xcol=#    Number of columns of data
xmin=#    Use this value to window x data
xmax=#    Use this value to window x data
ymin=#    Use this value to window y data
ymax=#    Use this value to window y data

The default options are +gsv -r 10 .The default minimum and maximum of x, y and z are the data minimum and maximum. In the default case, the number of x columns of data is estimated automatically. In 2D mode the z values are taken from the x-error bar column. The numbers returned can be plotted in either 2D or 3D mode.

By indicating data are a "perfect" or "near" grid and/or "properly" sorted, you can save time otherwise used in unnecessary preprocessing of the data.

A perfect grid means that if there are N columns and M rows, the total number of points is N times M. In addition, the x and y values need to be equally spaced. In the current version of contour.4 a different algorithm is used for data in a perfect grid than for the other case. The perfect-grid algorithm returns smoother contours than does the alternate algorithm. Also, the data points for each contour are in consecutive order, so that they may be plotted with patterned lines. With the alternate algorithm, the data points are returned as line segments that form columns on the page.

A near grid requires the x data to be in columns, although not all columns must have the same number of points.

Properly sorted data means the data are sorted by increasing values of x. Data with the same x values is sorted by increasing values of y. If x values within a given column of data are not identical, data points within that column must be sorted by y, with the sort by y taking priority over the sort by x.

If the data are a grid, the function determines the number of columns from the number of points in the first column, which ends when the y values first turn over. If the data are not a grid but are sorted, or if the data are a "near" grid, the function counts the number of columns by counting the number of times the y values turn over.

If the data are not a grid and are not presorted, and if you don't specify the number of columns of data, the function estimates that number using the following rules:

After the function sorts the data by x, it counts the number of times the y values turn over. If this number is less than the maximum number of columns (1024) and less than the one-third the number of points, that value is used. Otherwise, the number of columns is simply set to the square root of the number of points rounded to the nearest integer.

The contour.4 function will produce an approximation of a contour plot even if the input data are randomly scattered over the x-y plane.

In 3D mode, contour.4 returns new x, y and z values. In 2D mode, the contour (or z values) are returned in the x-error bar column. One could use various UNIX utilities to extract data points along the same contour, place them into separate files, read them back and plot them with unique symbols or pen colors.

Reusing the previous data can save time if you are interested in generating different contour ranges or intervals with the same data set. Only changes to the contour minimum, maximum or number of contour intervals have any effect when using the "reuse" option.

Entering a negative number for the number of contour intervals selects logarithmic contour spacing. The minimum and maximum contour values selected must, of course, be positive numbers.

EXAMPLES

fn contour.4 +sgv 15 zmin=-2 zmax=2.5

SEE ALSO

eb lc fn