Skip to content

contourplus.gle

Library about colored contour plots.

Copyright (c) 2020 Francois Tonneau

License: MIT


BACKGROUND INFORMATION


In GLE, the starting point for a contour plot consists of a dataset in the

z-file format (see the User Manual for more information about z files).

For example, from a z-file named myfile.z, a GLE script with a 'begin contour

... end' block will produce three auxiliary files:

myfile-cvalues.dat, which lists the set of z values (without repetitions)

myfile-cdata.dat, which lists series of x, y data for each contour line

myfile-clabels.dat, which specifies the z label for each contour line

contained in myfile-cdata.dat

These files can then be used to draw contour plots.


LIBRARY SUMMARY


This library, contourplus.gle, provides a single subroutine:

contourlines myfile$ colorize$

that draws the contour lines of myfile-cdata.dat with colors. The subroutine

works by scanning myfile-cdata.dat and retrieving the z value/level of each

contour from myfile-clabels.dat.


contourlines PARAMETERS:


myfile$: the name, without extension, of the datafile to be plotted; for

example: myfile

colorize$: the name of a subroutine that returns a color as a function of

a numeric parameter


SUBROUTINE


sub contourlines myfile$ colorize$