I have a data file which looks roughly like this
# X Y Value
1 1 1.5
1 2 2.5
2 1 NaN
2 2 3.0
I want to create a scatter plot in Gnuplot with crosses at each point and a label with the value beside it.
set datafile missing "NaN"
plot "data.txt" using 1:2:3 with labels left, \
"data.txt" using 1:2 with points
I would like to see a label with a literal string NaN for the points with an undefined value. Instead no label is printed. Is there a setting to force undefined values to be printed?
I tried this, but still no labels for undefined values:
plot "data.txt" using 1:2:(($3==$3) ? $3 : "NaN") with labels left
It looks like the undefined points are skipped altogether
The following works just fine for me (gnuplot 4.4 and gnuplot 4.6):
In fact, copy/pasting your original code works for me as well:
Perhaps you’re not noticing the labels because they are almost off the screen?
helps them to be a little easier to see…