I propose a flag to have gnuplot treat invalid data (like 1/0) to be treated as missing data values. That would allow doing simple filtering to skip points inside of gnuplot's using statement and still have the data plotted with lines:
set datafile undefined_as_missing
set xrange [0:10]
set samples 101
plot '+' using 1:(y=-($1-5)**2, y < -5 ? y : 1/0) with lines
I know, that the option name is quite bad, but shows what I intend. In case this patch gets accepted, I would include the respective option name to show.c and the docs.
I'll have to think about this one. My first inclination is that the intervention is in the wrong place. Wouldn't this simpler patch be sufficient?
Is there any case when one might want to distinguish between "undefined" in x (column ), y (column 2), or some other value (columns 3 and up)? All three cases currently return DF_UNDEFINED from df_readline() but the caller could inspect the values that were returned to see which one[s] are the cause.
I'm vaguely thinking you might want to distinguish between undefined x (no data point was measured; i.e. "missing") and undefined y (data point was measured but gave some weird value; i.e. not "missing").
Add a variant of this to CVS for 5.0 5.1 that uses the syntax
set datafile missing NaN
or
set datafile missing "NaN"