7. Surfaces, contours, and other 3D plots

Powerful three-dimensional capabilities of plotdata allow us to look at the data that represents functions of two variables, rather than simply that we have been discussing so far. This 3D data can be read in from a file or generated via plotdata commands and macros.

Outside plotdata, use your favourite editor to create the data file m.dat with the following data in it:

   0.00  0.01  0.16  0.18  0.16  0.01  0.00
   0.16  0.20  0.32  0.36  0.32  0.20  0.16
   0.07  0.54  0.68  1.00  0.68  0.54  0.07
   0.16  0.20  0.32  0.36  0.32  0.20  0.16
   0.00  0.01  0.16  0.18  0.16  0.01  0.00
Bring this data into plotdata:

PLOTDATA: read/matrix m.dat m 7
PLOTDATA: listm m

where listm confirms that the data has been read in as a 7x5 matrix. There are several ways to look at this data, all of them representing different renditions of the same 3D surface. You may want to try several of the different ways shown below until you find the rendition that you like the best:

PLOTDATA: surface m
PLOTDATA: surface m 1 0 45 -65
PLOTDATA: density m
PLOTDATA: density/diffusion/profile m
PLOTDATA: contour m
Enter specific contour levels (Yes or No) no
Enter: number_of_contours{min {inc {label_size{legend_size}}}
>> 10
Enter specific contour levels ( Yes or No ) no

Don't forget to clear between different commands, to have each try show up separately. As usual, to interpret what the different parameters are and to find out about other possibilities, you should use the help command and/or look things up in an appropriate manual or in the on-line help facility.

Up: Table of contents Next: 7.1 Generating 3D data Previous: 6. Changing the default settings