I have a program which outputs to the terminal a number, one line at a time. My goal is to have something else read these numbers and graph them in a line plot in real time. matplotlib and wxpython have been suggested, but I'm not sure how to go about implementing these.
Asked
Active
Viewed 1,638 times
1
-
Where will output be rendered? Web page? – ficuscr Aug 21 '12 at 17:26
-
It can be on any old interface that can be viewed from the desktop. – user1614912 Aug 21 '12 at 18:29
2 Answers
1
See the following links:
- What is the best real time plotting widget for wxPython?
- Minimalistic Real-Time Plotting in Python
- http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/
- http://wxpython-users.1045709.n5.nabble.com/real-time-data-plots-td2344816.html
As some of those point out, you might be able to use wx's PyPlot for something really simple or use Chaco.

Community
- 1
- 1

Mike Driscoll
- 32,629
- 8
- 45
- 88
0
I really like this library for HTML5 graphing. Here is demo of real time updates: http://dygraphs.com/gallery/#g/dynamic-update
Are you simply asking for recommendations on plotting libs?

ficuscr
- 6,975
- 2
- 32
- 52
-
Something like what you linked, except rather than random data, it would plot the numbers being output line by line in real time. I was thinking of using a pipe:./output | python graph.py – user1614912 Aug 21 '12 at 18:31
-
Would be pretty easy to alter that JS code to read from a file you are piping output to. (note the link to view that demo in jsFiddle) Main distinction I think being this is a 'web' solution and I am still unclear if that is what you desire. That said if your criteria is "It can be on any old interface that can be viewed from the desktop" I suppose it could fit. – ficuscr Aug 21 '12 at 18:36
-
-
What type of application? You develop in Python? A little lost. Talk of 'desktop' makes me think we are talking Windows? What language you envisioning the application being written in? – ficuscr Aug 21 '12 at 18:45
-
The program outputting the numbers is for linux on a red hat server (I'm using tightvnc). Doesn't matter what the application is written in, but if ./program | python graph.py could yield a graph plotting program's numbers in real time, then that would be great. Is there a way to view the jsFiddle's demo by, let's say, calling it from the terminal? My knowledge is limited for this, sorry :/ – user1614912 Aug 21 '12 at 19:04
-
Running a server like httpd/apache on your RHEL box you could view the data with a web browser from any remote machine over the Internet. Wondering a little now what this data is. You familiar with exiting tools like nagios/cacti? – ficuscr Aug 21 '12 at 19:09
-
The data is simply numbers in this format: 100 \n 1000 \n 11 \n etc. And I'm not at all familiar with them. – user1614912 Aug 21 '12 at 19:37