I need some sort of tool for plotting a continuous stream of data. In other words, I have a program, let’s call it A, that runs a simulation and outputs a continuous stream of numbers. Because A is processor-intensive, it might be running either on a dedicated computer for batch jobs, at home for using my graphics card, or in our pet super-computers grid. So, I want to keep A as simple as possible, it must only take care of computing the numbers and sending them to standard output or to a pipe. But I want to see the numbers as they come out, so, in my desktop, I need a second program B that be watching the output of A and plotting them in real time
So, that’s my question: what can I use as a B program? Is there any tweak that can be done with gnuplot, matplotlib, or any other tool? I would prefer a simple setup that doesn’t require to be fumbling with code for an entire day.
Thanks in advance.
For matplotlib, something very simple could be the following:
This will loop indefinitely (until you hit Ctrl+C), and eats up numbers from the stdin. I didn’t give it much thought, so it may lack in details, but as you didn’t have anything to start from, I’ve kept it simple.