Credits Overview Plotting Styles Commands Terminals

set datafile missing

Syntax:

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

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. Gnuplot makes a distinction between missing data and invalid data (e.g. "NaN", 1/0.). For example invalid data causes a gap in a line drawn through sequential data points; missing data does not.

Non-numeric characters found in a numeric field will usually be interpreted as invalid rather than as a missing data point unless they happen to match the missing string.

Conversely set datafile missing NaN causes all data or expressions evaluating to not-a-number (NaN) to be treated as missing data. See the imageNaN demo.

The program notices a missing value flag in column N when the using specifier in a plot command directly refers to the column as using N, using ($N), or using (function($N)). In these cases the expression, e.g. func($N), is not evaluated at all.

The current gnuplot version also notices direct references of the form (column(N)), and it notices during evaluation if the expression depends even indirectly on a column value flagged "missing".

In all these cases the program treats the entire input data line as if it were not present at all. However if an expression depends on a data value that is truly missing (e.g. an empty field in a csv file) it may not be caught by these checks. If it evaluates to NaN it will be treated as invalid data rather than as a missing data point. If you want to treat such invalid data the same as missing data, use the command set datafile missing NaN.