|
From: Petr M. <mi...@ph...> - 2005-10-23 07:23:14
|
> You don't find it confusing that in 2D plots you need to say
> plot 'data' matrix using ($1):($3)
>
> Why ($3)?
I never know I can use
plot ... matrix
I'm still learning gnuplot :-))
It would be nice to organize that
plot 'a.dat' matrix
is equivalent to
plot 'a.dat' matrix using 1:3
***
Proposal for 'help matrix', please modify:
Datafile can be in an ascii or binary matrix format. The `matrix` flag
indicates that the file is ascii, the `binary` or `matrix binary` stands for
a binary format. For details, see `matrix ascii` or `matrix binary`.
Basic usage in `splot`:
splot 'a.dat' matrix
splot 'a.gpbin' {matrix} binary
Advanced usage in `splot`:
splot 'a.dat' matrix using 1:2:3
splot 'a.gpbin' {matrix} binary using 1:2:3
allows to manipulate the axes coordinates and the z-data.
Usage in `plot`:
plot `a.dat` matrix using 1:3
plot 'a.gpbin' {matrix} binary using 1:3
will plot rows of the matrix, while using 2:3 will plot matrix columns, and
1:2 point coordinates. Applying the `every` option you can specify explicit
rows and columns.
Example -- rescale axes for an ascii matrix:
splot `a.dat` matrix using (1+$1):(1+$2*10):3
Example -- plot the 3rd row of an ascii matrix:
plot 'a.dat' matrix using 1:3 every 1:999:1:2
(rows are enumerated from 0, thus 2 instead of 3).
***
Proposal for 'help matrix ascii', please modify:
The `matrix` flag in
{s}plot 'a.dat' matrix
indicates that the ASCII data are stored in 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.
X- and y-indices of the matrix correspond to column and row index of the
matrix, starting from 0. You can rescale or transform the axes as usual for
a data file with three columns (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.
---
PM
|