7. Surfaces, contours, and other 3D plots

Powerful three-dimensional capabilities of physica 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 physica commands and macros.

Outside physica, 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 physica:

PHYSICA: read\matrix m.dat m 5 7
PHYSICA: list\matrix 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:

PHYSICA: surface m
PHYSICA: surface\hist m 45 -65
PHYSICA: density m
PHYSICA: density\diffusion\profile m
PHYSICA: contour m 10

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