hidetzugu - 2014-07-15

I want to pick the points from two columns in a file that have nan on a third column. So the file looks like this:

1.1 2.4 3
2.3 4.6 5
3.5 3.9 5
3.2 1.5 nan
2.2 2.3 5
5.5 1.4 3
3.4 2.7 -nan
2.7 4.5 nan

... and I want gnuplot to only display the points from rows 4,7 and 8.

normally in this kind of situation I, if I wanted to only display points with "5" in the third column I would do something like this (not sure if there is a cleaner way to reject points than setting the second output to 1/0):

booleantest(a,c)=c? a: 1/0
plot inputfiles using (booleantest($1,$3==5)):2 w p t "test"

How do I make a comparison to "nan"? is there a way to have a boolean operator comparing to a string?

 

Last edit: hidetzugu 2014-07-16