I have a combination RPi/Arduino taking readings from several DHT-22 Humidity/Temperature sensors.
One of the sensors developed a loose wire and has been giving occasi
Gnuplot allows you to filter data while plotting:
gnuplot 'file.dat' using 1:($2 == 0.0 ? 1/0 : $2)
This treats all values of 0
as invalid points and those points are skipped. Depending on the selected plotting style that works, or not: plot ... with lines
interrupts a line at an invalid point.
Since gnuplot version 5.0.6 you can use set datafile missing NaN
to have invalid points treated as missing ones, and a line would simply ignore those points:
$data <<EOD
12
27
0
23
42
EOD
set multiplot layout 1,2
set title '0.0 invalid'
plot $data using 0:($1 == 0.0 ? 1/0 : $1) with linespoints pt 7 notitle
set title '0.0 invalid but treated as missing'
set datafile missing NaN
replot
unset multiplot
Output with 5.0.6: