I need to plot data in real time, reading a file over and over and
update a the screen. How to implement reread and replot?
Are you on Windows? Or, which OS?
I do something similar as you want to do (on Windows): I write data
coming from an ADC to Disk (using a c-programm), update line by line
each 1…60 seconds, and I read this file with Ruby and send the data
from Ruby to gnuplot, doing 2d-plots, updating the plot each time Ruby
reads a new data line.
For reading the file I use: file-tail.
For “real-time” plotting with gnuplot I took a lot from here and
transfered it to Ruby:
The suggestion works perfect for me. I used a separate thread and a
queue to communicate when new data i available instead of sleep.
It seems more flexible to use pipes than the wrapper, but the wrapper
maybe gives nicer code.
Thanks
Lars
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.