Python 中实时图表的好框架吗?

发布于 2024-09-11 22:55:34 字数 248 浏览 2 评论 0原文

我正在开发一个 Python 应用程序,该应用程序涉及对实时数据运行回归分析,并将两者绘制成图表。也就是说,应用程序会收到实时数据,并且回归模型会随着数据更新而重新计算。请注意,我想在同一个图表中绘制输入(数据)和输出(回归分析)。

我之前用 Matplotlib 做过一些工作。这是最好的框架吗?它似乎相当静态,我找不到任何与上面类似的好例子。对我来说它也显得相当臃肿。性能是关键,所以如果有任何快速且占用空间小的 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...

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

剩余の解释 2024-09-18 22:55:34

我已经用 matplotlib 做了相当多的动画绘图 - 它总是需要我一些争论才能让它工作。

这是一个很好的例子:

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

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

挽手叙旧 2024-09-18 22:55:34

我没有使用过 Matplotlib,但我总是发现 gnuplot 足以满足我所有的图表需求。
您可以选择从 python 调用 gnuplot 或使用 gnuplot.py
(gnuplot-py.sourceforge.net) 与 gnuplot 交互。

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.

半透明的墙 2024-09-18 22:55:34

您可以使用 OpenFlash Chart会给你一个非常好的输出。
您不必拥有 Flash(它可以在 Flex 上使用),并且有一个 python 库 以一种很好的 Python 方式写下图表:

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

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文