Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

High-performance realtime data display

I'm trying to find a tool for plotting data (mostly line graphs and such) that can be used for high performance applications. My data window typically contains between 500 to several thousand points, and I'd be happy with a framerate of 10 or so. I receive my data as a binary stream on a socket. I am on Mac OS X.

I've tried several solutions, and I discuss my experiences with them below.

R: Dreadfully slow and unable to keep up, painful to read sockets, graph flickers.

matplotlib: Pretty slow but a little usable, also. However, it requires a ton of Python machinery to run, and IMO the API is pretty opaque. Under constant updating, the window containing the graph becomes modal and the Mac beachball appears -- not great for user interaction.

Gnuplot: Much better performance and API. However, communicating large quantities of data to gnuplot happens by generating temporary ASCII (!) files -- this means if my framerate goes up, I'm starting to do tons of disk reads and this is a performance issue.

Any other suggestions?

like image 639
Jake Avatar asked Feb 06 '12 15:02

Jake


1 Answers

Try gnuplot using piped data rather than temporary files. Example usage:

plot "data_acquisition_cmd <" with image

You can pipe in an endless stream of replots by reading commands from a pipe as well:

load "while [ 1 ]; do echo 'replot'; done <"

For a more robust solution, consider using an interface to gnuplot from Perl, like GnuplotIF, or Python (gnuplot.py), since they permit both programmatic control of gnuplot and the ability to pass data directly to it.

Edit: Thanks Jonhoo for the syntax correction

like image 79
Phil H Avatar answered Nov 20 '22 22:11

Phil H