On Monday 28 August 2006 12:43 pm, Petr Mikulik wrote:
> I think datafiles should not have "stupid" values, but, amazingly,
> gnuplot does not ignore such lines; try this:
> 0.1 10 1.111
> 0.2 20 2.222
> 0.3 bla 3.333
> 0.4 40 4.444
> gnuplot> set table; plot 'bla1'
> #Curve 0 of 1, 4 points
> #x y type
> 0.1 10 i
> 0.2 20 i
> 2 0.3 i
> 0.4 40 i
That is exactly what is documented in the help file.
I agree it is stupid, but it has been that way since forever.
In the absence of a 'using' keyword, the program re-evaluates
the intended meaning of the columns all over again for each line
in the input file. The line
0.2 20 2.222
is interpreted as having 3 valid columns, therefore the 1st
column is used for x=0.2 and the second column for y=20.
0.3 bla 3.333
is interpreted as having only 1 valid column. Therefore the
1st column is interpreted as y=0.3 (*NOT X*) and the x=2 value
is taken as being implicitly determined by the input line #,
equivalent to 'column 0'.
> gnuplot> set table; splot 'bla1'
> #Surface 0 of 1 surfaces
> #IsoCurve 0, 4 points
> #x y z type
> 0.1 10 1.111 i
> 0.2 20 2.222 i
> 2 0 0.3 i
> 0.4 40 4.444 i
> Even that this has no relation to "set datafile missing", the
> "replacement" values are strange -- 'help missing' even says
Again, this is exactly what is documented.
Only 1 valid number is read from the line
0.3 bla 3.333
So that value is assumed to mean z=0.3, while the x=2 and y=0
values are generated implicitly from the line number
and the isocurve number, respectively.
> Further, the first example in 'help missing' + its description seems
> to be wrong.
It looks correct to me.
I believe we have reached the point where we should just say
the a 'using' keyword is required. For backwards compatibility,
in the absence of a 'using' specifier the code will behave as
the documents have always stated, and you show above.
Therefore, odd as the behavior may be, I think we should not change
the documented behavior for no using spec.
However, I think we very definitely should fix the currently broken
splot 'foo' using 1:2:3
in the presence of nonsense or NaN strings
Unfortunately, I have not found a simple fix for this yet.
I can make it work, but only be substantially re-writing the
input code in datafile.c. The presence of the binary read
routines is an additional complication.
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle WA