14.10.2014 Views

gnuplot documentation

gnuplot documentation

gnuplot documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

152 <strong>gnuplot</strong> 4.3 72 SPLOT<br />

1 0 10<br />

1 1 5<br />

1 2 10<br />

2 0 10<br />

2 1 1<br />

2 2 10<br />

3 0 10<br />

3 1 0<br />

3 2 10<br />

Note that "datafile.dat" defines a 4 by 3 grid ( 4 rows of 3 points each ). Rows (datablocks) are separated<br />

by blank records.<br />

Note also that the x value is held constant within each dataline. If you instead keep y constant, and<br />

plot with hidden-line removal enabled, you will find that the surface is drawn ’inside-out’.<br />

Actually for grid data it is not necessary to keep the x values constant within a datablock, nor is it<br />

necessary to keep the same sequence of y values. <strong>gnuplot</strong> requires only that the number of points be<br />

the same for each datablock. However since the surface mesh, from which contours are derived, connects<br />

sequentially corresponding points, the effect of an irregular grid on a surface plot is unpredictable and<br />

should be examined on a case-by-case basis.<br />

72.1.3 Matrix ascii<br />

The matrix keyword (without a sequent binary keyword) in<br />

{s}plot ’a.dat’ matrix<br />

indicates that data are stored in an ascii numbers matrix format.<br />

The z-values are read in a row at a time, i. e.,<br />

z11 z12 z13 z14 ...<br />

z21 z22 z23 z24 ...<br />

z31 z32 z33 z34 ...<br />

and so forth.<br />

In 3D, the x- and y-indices of the matrix surface plot correspond to column and row indices of the<br />

matrix, respectively, being enumerated from 0. You can rescale or transform the axes as usual for a data<br />

file with three columns by means of x=$1, y=$2, z=$3. For example<br />

splot ’a.dat’ matrix using (1+$1/100):(1+$2*10):3<br />

A blank line or comment line ends the matrix, and starts a new surface mesh. You can select among<br />

the meshes inside a file by the index option to the splot command, as usual.<br />

See matrix (p. 152) for examples of plotting rows and columns of the matrix in a 2D plot.<br />

72.1.4 Matrix<br />

Datafile can be in an ascii or binary matrix format. The matrix flag indicates that the file is ascii,<br />

the binary or matrix binary stands for a binary format. For details, see matrix ascii (p. 152) and<br />

matrix binary (p. 151).<br />

Basic usage in splot:<br />

splot ’a.dat’ matrix<br />

splot ’a.gpbin’ {matrix} binary<br />

Advanced usage in splot:<br />

splot ’a.dat’ matrix using 1:2:3<br />

splot ’a.gpbin’ {matrix} binary using 1:2:3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!