From: Hans-Bernhard B. <br...@ph...> - 2004-06-10 20:52:30
|
On Wed, 9 Jun 2004, Ethan Merritt wrote: > Here is the entirety of the change at issue: > /* > * EAM - Oct 2002 Distinguish between DF_MISSING and DF_BAD. > * Previous versions would never notify caller of either case. > * Now missing data will be noted. Bad data should arguably be > * noted also, but that would change existing default behavior. > */ > else if ((column <= df_no_cols) && (df_column[column - 1].good == DF_MISSING)) > return DF_UNDEFINED; > > The comment was correct. Without this change the code was IMHO broken, > and worked as it did only by accident. It did match the documentation, though, which I don't think was an accident. > With the change, the missing data is explicitly reported as such by > the code in datafile.c. Not quite. df_tokenize() reports DF_MISSING, but df_readline now translates that into DF_UNDEFINED instead of 'no data'. The effect is that of an empty line, not a missing line, in the case of 'with lines'. > As I recall, the reason I noticed the original problem was that with the > version 3.7 code it was not possible to guarantee reasonable behavior > from missing data for box plots or candlesticks. I don't know that I can > reproduce an example of the failure quickly, but I can try if needed. Please do. > The other problem was that you could not tell gnuplot that '0' or 'NaN' > or some other numerically-parsable flag indicated missing data. NaN, if scanf() supports it at all will quite certainly do that in 4.0, because there's now an additional sanity check between datafile reading and datapoints being used. And if you want to use '0' for that, I don't agree 'set missing' is the way to do that. That's what we have using 1:($3==0?0/0:$3) or similar constructs for. > This was a problem for tabular data that used 0 as a place-holder. Such tabular data is IMHO broken by design. > > So: which do we change: the code or the docs? > > I think the docs should be changed. > should be modified so that missing data does not produce > breaks in the line. As long as missing data output DF_UNDEFINED from datafile.c, it must. Otherwise we'ld be changing the behaviour of piecewise functions in a seriously broken manner, e.g. plot [-10:10] abs(x)>5?abs(x):0/0 w l would suddenly have a connection between points (-5,-5) and (5,5), which we quite definitely don't want. -- Hans-Bernhard Broeker (br...@ph...) Even if all the snow were burnt, ashes would remain. |