I am using Gnuplot G N U P L O T Version 5.1 patchlevel 0 last modified 2017-05-08 on OS X 10.11.2, and I get the following behavior which I do not understand. Given the following file 'data.dat' http://ge.tt/4Qejp6k2 , I execute
p for [i=1:4] 'data.dat' u 1:(column(1+i)) w l
Because there are only four columns in data.dat, this plot is out of range, but it gives me no error message, it just plots columns 2 to 4. Why? I would like to have an error message in order to find out when I am doing something wrong, and I seem to recall that I did get an error message with other Gnuplot versions.
Thank you.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
An empty plot generated during an iteration is not considered an error.
This is intentional. Consider a hypothetical script command:
plot for [n=1:99] sprintf( "datafile_%d.dat", n)
It would be really annoying if you lost plots 50-99 just because
datafile_49.dat was missing or empty.
The program does give a warning in some cases, but I agree it is not 100%
consistent about the warning.
This gives a warning:
plot for [n=1:toobig] 'file' using 0:n
This does not
plot for [n=1:toobig] 'file' using 0:(column(n))
I don't see any difference between current cvs and older versions back to
5.0.2 in this regard.
I am using Gnuplot G N U P L O T Version 5.1 patchlevel 0 last modified 2017-05-08 on OS X 10.11.2, and I get the following behavior which I do not understand. Given the following file 'data.dat' http://ge.tt/4Qejp6k2 , I execute
p for [i=1:4] 'data.dat' u 1:(column(1+i)) w l
Because there are only four columns in data.dat, this plot is out of range, but it gives me no error message, it just plots columns 2 to 4. Why? I would like to have an error message in order to find out when I am doing something wrong, and I seem to recall that I did get an error message with other Gnuplot versions.
Thank you.
To find the number of columns in a file:
Thank you, but that does not answer my question.
An empty plot generated during an iteration is not considered an error.
This is intentional. Consider a hypothetical script command:
plot for [n=1:99] sprintf( "datafile_%d.dat", n)
It would be really annoying if you lost plots 50-99 just because
datafile_49.dat was missing or empty.
The program does give a warning in some cases, but I agree it is not 100%
consistent about the warning.
This gives a warning:
plot for [n=1:toobig] 'file' using 0:n
This does not
plot for [n=1:toobig] 'file' using 0:(column(n))
I don't see any difference between current cvs and older versions back to
5.0.2 in this regard.
On Mon, May 15, 2017 at 2:28 PM, James james1979@users.sf.net wrote: