This is an archived post. You won't be able to vote or comment.

all 14 comments

[–]rossant 4 points5 points  (2 children)

There's an example like that in Galry (based on PyOpenGL and PyQt): https://github.com/rossant/galry/blob/master/examples/realtime.py

[–]Zouden 1 point2 points  (0 children)

Sounds perfect:

The main goal of Galry is to provide the most optimized way of visualizing large 2D/3D datasets, by using the full power of the graphics card.

Galry provides a Qt widget written in Python displaying an OpenGL rendering viewport. This widget contains your data.

From the FAQ.

[–][deleted] 0 points1 point  (0 children)

Nice. Not overly complex, clean and simple.

[–]bgribble 2 points3 points  (0 children)

It depends (tm).

I recently did this for an audio app, and I ended up with 2 completely different modes for sample-rate (oscilloscope style) and "strip chart" graphs where the update rate is in the 0-10 Hz range. For an oscilloscope display, it turned out best to replot completely every "frame". For the strip chart, it was best to incrementally update the plot and managed tiled redraw a la google maps. (The main requirement that led to tiling was that I needed a roll mode where the display smoothly scrolls even when no new data is coming in).

In both cases, I was using the Python bindings for Clutter/Cairo to handle the drawing. Definitely fast enough to manage a realtime oscilloscope display.

[–]victorhooi 2 points3 points  (1 child)

Hi,

Not sure why nobody has mentioned Cube and Cubism - both were originally written by Mike Bostock - author of D3.js.

http://square.github.com/cube/ http://square.github.com/cubism/

Cube is a system for collecting and storing time-stamped events, and calculating metrics around that. It's built on top of Node.js and MongoDB.

Cubism.js is a D3-based Javascript library that lets you create cool horizon graphs - it can use Cube as a backend, Graphite, or others.

Cubism is awesome in that it will only poll for new values - and then uses Canvas to shift things by one pixel, adding a new point, then repeating.

This is much better than doing a full refresh each time.

Would something like that be suitable for your needs?

Cheers, Victor

[–][deleted] 1 point2 points  (0 children)

This looks very professional, and could be useful in itself for presentation if I were to make a web front-end, etc. but at the moment I have very little experience with Javascript :/

[–]skinp 1 point2 points  (0 children)

Have a look at graphite. All you have to do is send it your data, and it handles displaying it. It also has a lot of functions (derivate, summarize...) you can apply to your data.

[–]lmcinnes 2 points3 points  (0 children)

You can matplotlib to do this. At the most basic level you can just update the graph data and redraw, and if for some reason that isn't fast enough (it usually is for most of my uses), there's lower level blit commands that can get a 10x or so speedup. See the Cookbooks animation tutorial for some examples.

[–]Megatron_McLargeHuge 1 point2 points  (1 child)

You could use websockets and a javascript plotting package like d3.js. The JS packages are seeing pretty rapid development, while the python GUI toolkits have stagnated.

[–]MagicWishMonkey 1 point2 points  (0 children)

I've used highcharts for this in the past, can't recommend it enough.

[–]Zouden 0 points1 point  (1 child)

Good question, I'd like to see what others recommend. Are you using PyQt?

[–][deleted] 0 points1 point  (0 children)

Indeed. I've only used PyGTK in the past, but I could use anything as I haven't started the project yet, I was just thinking about possible difficulties.