next up previous contents index
Next: Matrix Up: Data-file Previous: Example datafile   Contents   Index


Matrix_ascii

The matrix keyword (without a sequent binary keyword) in
   {s}plot 'a.dat' matrix

indicates that data are stored in an ascii numbers matrix format.

The z-values are read in a row at a time, i. e.,

   z11 z12 z13 z14 ...
   z21 z22 z23 z24 ...
   z31 z32 z33 z34 ...

and so forth.

In 3D, the x- and y-indices of the matrix surface plot correspond to column and row indices of the matrix, respectively, being enumerated from 0. You can rescale or transform the axes as usual for a data file with three columns by means of x=$1, y=$2, z=$3. For example

   splot 'a.dat' matrix using (1+$1/100):(1+$2*10):3

A blank line or comment line ends the matrix, and starts a new surface mesh. You can select among the meshes inside a file by the index option to the splot command, as usual.

See matrix (p. [*]) for examples of plotting rows and columns of the matrix in a 2D plot.


Ethan Merritt 2007-03-03