conditional - How to conditionally plot in gnuplot with missing or invalid data? -
conditional - How to conditionally plot in gnuplot with missing or invalid data? -
in gnuplot (i'm using 5.1 cvs) 1 can specify missing info (set datafile missing '?'
example) , gnuplot knows invalid info (like nan
or 1/0
).
how can conditionally react them? if info has 1 of them sometimes (i.e. on columns, not on all) want else instead of skipping them. so, want (pseudocode)
plot 'datafile' using 1:($2 = missing ? $3+$4 : $2 )
i can utilize strcol(2)
check column content, not work string specified missing set datafile missing '?'
because string specified set datafile missing
seems have higher "importance", because can't check using colstr()
(gnuplot stops handling datapoint before comes evaluating strcol()
).
my info can have missing info in several columns. if is, example, missing in column 2 want gap in info (like it's invalid), if in column 3 want plot else instead , not leaving gap.
for invalid info (like pre-defined nan
) works fine. skipped when appearing in data, can react saying strcol(2) == 'nan' ? $3+$4 : $2
. invalid data, gnuplot first evaluates strcol()
if (and if) there.
i can simulate behaviour using 2 "missing chars", 1 utilize set datafile missing
, 1 utilize strcol()
checks. ugly workaround, have edit datafiles , replacing half of missing chars hand. there way handle missing info conditionally, 1 can handle invalid data?
plot conditional gnuplot missing-data
Comments
Post a Comment