Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good framework for live charting in Python?

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...

like image 376
c00kiemonster Avatar asked Jul 28 '10 10:07

c00kiemonster


3 Answers

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

like image 91
Wayne Werner Avatar answered Oct 06 '22 16:10

Wayne Werner


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.

like image 32
domino Avatar answered Oct 06 '22 17:10

domino


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
like image 38
Mermoz Avatar answered Oct 06 '22 15:10

Mermoz