For a single graph, use set datafile missing to specify a character string that means the missing value, and the using $ qualifier to ensure that gnuplot leaves a space in the string for the missing value. Various using qualifiers are described in the gnuplot documentation for set datafile missing .
If the column number is specified as a variable, it is a little more complicated. For example, to build multiple columns of a file, you can specify the column number using a variable:
do for [i=2:10] { plot 'datafile' using ($1):i with lines }
However, if we try to use the $ syntax, it does not work:
do for [i=2:10] { plot 'datafile' using ($1):($i)
The solution is to use a column function that also leaves spaces for missing values:
do for [i=2:10] { plot 'datafile' using ($1):(column(i)) with lines }
Josh milthorpe
source share