| conplot |
| A contour plotting program written in perl. Version 1.30 is new on July 7, 2000 (has slight changes in setting the paths, and the optional use of a conplot_desc directory) |
![]() |
![]() |
Example of conplot showing off its abilities with color-fills, stretched grids, and vector fields.
conplot is a contour plotting program written in perl. I wrote conplot because my other program, d2ps, is not robust (it frequently crashes) and the output files are rather big. conplot also has its defects, one being that it is very slow. conplot can use data files in the gnuplot format. (The older version of conplot did not have this property and has been abandoned.)
set path=($path ~/conplot)That statement adds the directory conplot to your path. You will be able to use executable programs in conplot from any directory, the way you use gnuplot, for example.
makedataA file squash.dat should have appeared in your directory. Now make a plot with:
conplot squash.dat -k squash.desc squash.epsYou can make a color legend with:
clegend squash.eps %4.2f ghostview squash_clegend.eps
conplot squash.dat -k squash.desc squash.eps -bis a "batch" job the bypasses the display to the monitor.
x1, y1, z(x1,y1), u(x1,y1), v(x1,y1) x2, y1, z(x2,y1), u(x2,y1), v(x2,y1) x3, y1, z(x3,y1), u(x3,y1), v(x3,y1) x4, y1, z(x4,y1), u(x4,y1), v(x4,y1) ... blank line x1, y2, z(x1,y2), u(x1,y2), v(x1,y2) x2, y2, z(x2,y2), u(x2,y2), v(x2,y2) x3, y2, z(x3,y2), u(x3,y2), v(x3,y2) x4, y2, z(x4,y2), u(x4,y2), v(x4,y2) ...The format is compatible with gnuplot. See below.
#$in=17;$jn=17; #$title='alternative';Also, you may delete some, or all, of the blank lines in squash.dat. The array dimensions are determined by the values of $in and $jn. $in defines the number of points in the x-direction and $jn defines the number of points in the y-direction. (Deleting these blank lines makes squash.dat no longer compatible with gnuplot). Again try:
conplot squash.dat -k squash.desc squash.eps
The perl script cpalt can do the editing for you. Try:
cpalt squash.eps nogrid noregions noarrows contoursYou should see:

cpalt squash.eps grid regions arrows nocontours
/Helvetica 12 selectfont %uncomment next four lines for example labels 105 105 BX (this) show 305 205 BX (that) showThe numbers define the position of the lower left corner of the labels. These positions can be obtained by displaying the .eps with ghostview squash.eps and then pointing the cursor where you want the label. The ghostview window has a small box that displays the current coordinates of the cursor. You can write down those numbers, and then make label commands with a text editor.
convert +dither squash.eps squash.gifor, using the latest version of convert with Linux 6.1;
convert +antialias squash.eps squash.gifIf all goes well, squash.gif will be 23K. If it comes out to be about 205K, then blame the lawyers of Unisys.
Also, be sure to use the +dither or +antialias option. The command:
convert squash.eps squash.gifwill use the -dither (-antialias) as the default, and produce:

If you look closely, you can see the triangles that are part of the contouring algorithm, which is probably undesirable.
First download mydots, which contains lines with x y dot_index triplets. The dot_index can range from 1 to 8. Try:
conplot squash.dat -k squash.desc squash.eps -dots mydots
Near the end of squash.eps you will find %start_dots with definitions for Dot1, Dot2, etc. You can easily change the color, size and shape of these with a litte editing. (cpalt does not yet work with dots.)
Try:
conplot squash.dat -px
or
conplot squash.dat -pxx
The -pxx uses exactly one pixel per data point, and was used to make the images seen here . The -px option uses more than one pixel per data point, and scales the plot to look nice. Both of these options are much faster than making contours.
conplot squash.dat -k squash.desc -p '$colortable="red";'The -o options will be overidden by anything found in the description file. The -p option will be take precedence over what is found in the description file. (Note the required semicolon.)
conplot squash.dat -dk another.desc
gnuplot does things that conplot does not: rendering surfaces.
conplot has
been designed so that it can plot data files in the gnuplot format.
The file squash.dat made by makedata is such an example.
Let's see what gnuplot can do with the first three columns of the file.
First type gnuplot to bring up the gnuplot>
command line. Then:
gnuplot> set parametric gnuplot> set cntrparam levels incremental -.95,.1,.95 gnuplot> set contour base gnuplot> splot 'squash.dat' with lines gnuplot> set view 0,0,1 gnuplot> replot gnuplot> set nosurface gnuplot> replot
You should see plots like:
