next up previous contents index
Next: Set datafile separator Up: Datafile Previous: Set datafile nofpe_trap   Contents   Index

Set datafile missing

The set datafile missing command tells gnuplot there is a special string used in input data files to denote a missing data entry. There is no default character for missing, but in many cases any non-parseable string of characters found where a numerical value is expected will cause the line to be treated as missing data. There is a distinction between missing data and invalid data (e.g. "NaN", 1/0.). Invalid data causes a gap in the line drawn through the points; missing data does not.

Syntax:

     set datafile missing "<string>"
     show datafile missing
     unset datafile

Note: The treatment of certain cases has changed in this version of gnuplot. The example below shows the difference. Example:

     set style data linespoints
     plot '-' title "(a)"
        1 10
        2 20
        3 ?
        4 40
        5 50
        e
     set datafile missing "?"
     plot '-' title "(b)"
        1 10
        2 20
        3 ?
        4 40
        5 50
        e
     plot '-' using 1:2 title "(c)"
        1 10
        2 20
        3 NaN
        4 40
        5 50
        e
     plot '-' using 1:($2) title "(d)"
        1 10
        2 20
        3 NaN
        4 40
        5 50
        e

Plot (a) differs because the third line contains only one valid number. Old gnuplot versions switched to a single-datum-on-a-line convention that the line number is "x" and the datum is "y", erroneously placing the point at(2,3).

Both the old and new gnuplot versions handle the same data correctly if the '?' character is designated as a marker for missing data (b).

Old gnuplot versions handled NaN differently depending of the form of the using clause, as shown in plots (c) and (d). Gnuplot now handles NaN the same whether the input column was specified as N or ($N). See also the

http://www.gnuplot.info/demo/mgr.htmlimageNaN demo.


next up previous contents index
Next: Set datafile separator Up: Datafile Previous: Set datafile nofpe_trap   Contents   Index
2015-06-17