views:

83

answers:

3

I am working on a Python application that involves running regression analysis on live data, and charting both. That is, the application gets fed with live data, and the regression models re-calculates as the data updates. Please note that I want to plot both the input (the data) and output (the regression analysis) in the same one chart.

I have previously done some work with Matplotlib. Is that the best framework for this? It seems to be fairly static, I can't find any good examples similar to mine above. It also seems pretty bloated to me. Performance is key, so if there is any fast python charting framework out there with a small footprint, I'm all ears...

+1  A: 

I havent worked with Matplotlib but I've always found gnuplot to be adequate for all my charting needs. You have the option of calling gnuplot from python or using gnuplot.py (gnuplot-py.sourceforge.net) to interface to gnuplot.

domino
+1  A: 

I've done quite a bit of animated graphing with matplotlib - it always took me some wrangling to get it to work.

Here's a nice example though:

http://matplotlib.sourceforge.net/examples/animation/simple_anim_gtk.html

Wayne Werner
So the way to create a live chart in Matplotlib is to create an animated chart? Can you get good performance out of this?
c00kiemonster
basically, yes. You just set it up to draw when you get new data. I guess it depends on your definition of good performance...
Wayne Werner
+1  A: 

You can use OpenFlash Chart which wil give you a very nice output. You don't have to have flash (it works on Flex) and there is a python library to write down the charts in a nice pythonic manner:

def test_radar_charts_3():

chart = open_flash_chart()
chart.title = title(text='Radar Chart')

val1 = [30,50,60,70,80,90,100,115,130,115,100,90,80,70,60,50]
spokes = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p']
val2 = []

for i in val1:                                   
    txt = "#val#<br>Spoke: %s" % i 
    tmp = dot_value(value=i,  colour='#D41E47', tip=txt)
    val2.append(tmp)
line = line_hollow()
line.values = val2
line.halo_size = 0
line.width = 2
line.dot_size = 6
line.colour = '#FBB829'
line.text = 'Hearts'
line.font_size = 10
line.loop = True
chart.add_element(line)
r = radar_axis(max=150)
r.step = 10
r.colour = '#DAD5E0'
r.grid_colour = '#EFEFEF'
chart.radar_axis = r
tip = tooltip(proximity=1)
chart.tooltip = tip
chart.bg_colour = '#FFFFFF'
return chart
Mermoz