#### 3.25.16.3 set datafile missing

The ‘set datafile missing‘ command allows you to tell ‘gnuplot‘ what character string is used in a data file to denote missing data. Exactly how this missing value will be treated depends on the using specifier of the ‘plot‘ or ‘splot‘ command.

Syntax:

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

Example:

          # Ignore entries containing IEEE NaN ("Not a Number") code
          set datafile missing "NaN"

Example:

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

The first ‘plot‘ will recognize only the first datum in the "3 ?" line. It will use the single-datum-on-a-line convention that the line number is "x" and the datum is "y", so the point will be plotted (in this case erroneously) at (2,3).

The second and third ‘plot‘ commands will correctly ignore the middle line. The plotted line will connect the points at (2,20) and (4,40).

The fourth ‘plot‘ will also correctly ignore the middle line, but the plotted line will not connect the points at (2,20) and (4,40).

There is no default character for ‘missing‘, but in many cases any non-parsible string of characters found where a numerical value is expected will be treated as missing data.