gnuplot: Faulty sensor sometimes reading 0.00 - how to convert them to missing?

前端 未结 1 1187
青春惊慌失措
青春惊慌失措 2021-01-24 03:13

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

1条回答
  •  感情败类
    2021-01-24 03:49

    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 <

    Output with 5.0.6:

    0 讨论(0)
提交回复
热议问题