On Sunday 23 October 2005 12:23 am, Petr Mikulik wrote:
>
> It would be nice to organize that
> plot 'a.dat' matrix
> is equivalent to
> plot 'a.dat' matrix using 1:3
OK. That part is now in cvs.
I'm still amazed that this works.
Who knew that you could plot data rows?
I'm still confused by the documentation, and will try to
clarify it. For example, you suggest
> 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 ...
> X- and y-indices of the matrix correspond to column and row index of the
But this is not really correct, as the use of "plot <foo> matrix"
demonstrates. "Column 3" may or may not be a Z value, depending
on what kind of graph you are describing. My current best effort
at writing a description is:
Matrix values are read in a row at a time, i. e.,
M11 M12 M13 M14 ... (i=1)
M21 M22 M23 M24 ... (i=2)
M31 M32 M33 M34 ... (i=3)
... ... ... ... Mij
The interpretation of columns in the "using" specification for
matrix data is different from the usual case. "$1" refers to the
matrix row index i, "$2" refers to the matrix column index j,
and "$3" refers to the matrix entry Mij.
Example:
set view map
splot <foo> matrix using ($1 * 5.):2:(sqrt($3))
This example will plot the value sqrt(Mij) at the coordinates
x=5i, y=j for each entry i,j represented in the matrix.
Does this description seem OK to you?
> ***
>
> 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
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|