> this works:
> plot 'file.dat' mat w image
> but this doesn't anymore:
> plot 'file.dat' mat u 1:2:3 w image
>
> Comment By: Petr Mikulik (mikulik)
> Date: 2005-10-22 11:26
>
>> the x and y coords are coming from the row and column indices
>> of the file, right? So x is $0, but y is a problem because
>> we have no pseudo-column assigned for the column.
>
> no, x = $1, y = $2 (autogenerated row and column index of
> the matrix)
Apparently that is how the program currently interprets
$1 and $2. I dind't know that.
It is very confusing because it is not consistent with all other
plot/splot "datafile" commands. In all other cases $1 means
column 1 of the file, regardless of whether it is being used as
an x value.
> I think we have reduced the bug to this:
> This works (at least one of $1, $2 or $3 appears at least once):
> splot 'file.dat' matr u ($1/100):2:3
> This works in a very strange way:
> splot 'file.dat' matr u 1:2:3
>
> Once this is fixed, we can extend 'help matrix ascii' to
Sure, it should be fixed (although the behaviour has not
changed since 3.7 so the original bug report is misleading).
But I would like to provide a more logical syntax for this
operation, so that this confusion isn't necessary.
This is really just an axis-labelling operation, right?
The "true" x and y indices of the matrix points are still
integers running from 1 to however many rows/columns of
data are in the file.
How about if we could plot Petr's example:
splot 'matrix.dat' matrix using (1+$1/100):(1+$2*10):3
as
f(x) = 1 + x/100
g(y) = 1 + y*10
splot 'matrix.dat' matrix xticlabels(f(x)):yticlabels(g(y))
Would that be more natural?
Alternatively, we could allow dummy variables in the using specs
directly:
splot 'matrix.dat' matrix using (f(x)):(g(y)):(z)
Unfortunately that has no obvious meaning for non-matrix plots.
> ----------------------------------------------------------------------
>
> Comment By: Juergen Wieferink (wieferink)
> Date: 2005-10-22 09:18
>
> Message:
> Logged In: YES
> user_id=1090807
>
> Weird. You are right.
>
> Using ($1):($2):3 instead of 1:2:3 works fine, though. And even
> more confusing: When I try to play around with the ranges, I can
> find no systematic at all... Once I only set the xrange:
>
> plot [0:1] "file.dat" matrix using 1:2:3 with image
>
> It doesn't even respect the plot borders... There is something
> that really goes wrong here.
> I would attach the resulting image -- if I could.
>
> Juergen
>
>
> ----------------------------------------------------------------------
>
> Comment By: Ethan Merritt (sfeam)
> Date: 2005-10-21 23:11
>
> Message:
> Logged In: YES
> user_id=235620
>
> Huh.
> Were you using the data file provided in the bug report?
>
> I see the problem in 3.7, 4.0 and current cvs. Well, I
> don't see it as a "problem" because it does not seem like a
> reasonable command in the first place. See attached png output.
> file A: splot 'matrix.dat' matrix
> file B: splot 'matrix.dat' matrix using 1:2:3
>
>
>
> ----------------------------------------------------------------------
>
> Comment By: Juergen Wieferink (wieferink)
> Date: 2005-10-21 22:10
>
> Message:
> Logged In: YES
> user_id=1090807
>
> Ethan:
> It might be confusing, but it works -- at least for me.
>
>
> I have been using this for quite a while (I'd even say pre-4.0) in a
> wide set of scripts. And it has worked fine all the time. I cannot
> reproduce the problem of the OP.
>
> Juergen
>
>
> ----------------------------------------------------------------------
>
> Comment By: Ethan Merritt (sfeam)
> Date: 2005-10-21 21:54
>
> Message:
> Logged In: YES
> user_id=235620
>
> Petr:
> Your use of $1 and $2 in that example is confusing. IIn the
> case of 3D matrix data, the x and y coords are coming from
> the row and column indices of the file, right? So x is $0,
> and y is... well y is a problem, because we don't have a
> pseudo-column assigned for the column number.
>
> I assume your intent is more something like:
> splot 'file.dat' matrix thru f(x,y,z)
>
> even though x and y are being autogenerated from the file
> layout rather than being explicitly contained in the data.
>
>
> ----------------------------------------------------------------------
>
> Comment By: Petr Mikulik (mikulik)
> Date: 2005-10-21 21:38
>
> Message:
> Logged In: YES
> user_id=31505
>
> Thus
> splot 'file.dat' matrix using ($1*2):(1+10*$2):3
> can work? Then I would like it too -- I though axes
> transformations are not allowed for 'matrix'.
>
> When it works, it should be properly documented in 'help
> matrix', the best with few examples, like above.
>
>
> ----------------------------------------------------------------------
>
> Comment By: Hans-Bernhard Broeker (broeker)
> Date: 2005-10-21 21:07
>
> Message:
> Logged In: YES
> user_id=27517
>
> @Petr: no, that's not a bug, that's a very crucial feature.
> I'm strictly against going back to the ancient days when
> you couldn't do any parameter transformations on a data set
> just because it was given as 'matrix' or 'binary'. The
> difference caused by those have to be resolved for good, by
> the time 'using' and friends get applied.
>
> ----------------------------------------------------------------------
>
> Comment By: Martin Horvat (martin_horvat)
> Date: 2005-10-21 18:57
>
> Message:
> Logged In: YES
> user_id=473606
>
> Greatings,
>
> Thanks for the comments and the explanation. It just strange
> that few months ago this thing worked and all my scripts
> were accordingly modified. I don't really know the
> implementation of matrix data format, but the syntax "splot
> 'file.dat' mat u 1:2:3 w l" seems plausible to me. But ok,
> it doesn't matter, I rewrote the scripts and the programs
> and so on. Now I use basic (standard) gnuplot syntax and it
> works.
>
> Thanks guys.
>
> Best regards,
>
> Martin
>
> ----------------------------------------------------------------------
>
> Comment By: Petr Mikulik (mikulik)
> Date: 2005-10-21 18:28
>
> Message:
> Logged In: YES
> user_id=31505
>
> I think it is rather a bug that
> splot 'file.dat' mat u 1:2:3 w l
> passes the parser.
> Gnuplot works only with
> splot 'file.dat' matrix
> or
> splot 'file.dat' matrix using (f($1,$2,$3))
>
> I think an error should be issued if nb_of_using_params >= 2.
>
>
>
>
>
>
>
> ----------------------------------------------------------------------
>
> Comment By: Ethan Merritt (sfeam)
> Date: 2005-10-18 04:51
>
> Message:
> Logged In: YES
> user_id=235620
>
> I am inclined to close this report, since the command being
> used seems intrinsically incorrect for the data file
> provided as an example.
>
> The data file is entirely filled with z-values, with one
> entire row of values per line of the file. This is normal
> for matrix data. Trying to pull x and y out of columns in
> the files makes no sense at all, and will end up discarding
> all but 1 z-value per line.
>
> The earlier procedure you remember working must have
> involved a rather different layout of data in the file.
> Does that make sense?
>
> ----------------------------------------------------------------------
>
> You can respond by visiting:
> https://sourceforge.net/tracker/?func=detail&atid=102055&aid=1264105&gro
>up_id=2055
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|