Dynamic Chart in Python

ε祈祈猫儿з 提交于 2019-12-13 18:28:29

问题


I am essentially trying to replicate the google finance chart, but for sensor data. I would like to embed the chart in a GUI and have it update on a timer (which samples the sensor for it's value). I would like to incorporate panning, resizing, and adding moving averages, much like the google finance charts, all of which is updated at some steady interval.

Much of my code base is already in python, so I would like to stick with it. Can this be done with Python?

I have checked out matplotlib, but I am not sure if it can do dynamic charts. I am using wxPython to create the GUI.


回答1:


I recently came across Chaco from Enthought.

http://code.enthought.com/projects/chaco/

It is an open source framework written in Python that binds with wx, Qt etc and more usable than matplotlib for building full applications. Very usable and easily customizable. You can use the packaged panning, zooming tools or build your own.

I would suggest downloading the epd-free package to ensure you get all dependencies if you choose to move ahead with it.

http://www.enthought.com/products/epd_free.php/




回答2:


I just implement a method to draw dynamic charts in ipython notebook, you can check my blog post here : http://litaotao.github.io/dynamic-charts-matplotlib-alternative-ipython-notebook-python-drawing-js

and bellow is a screenshot:



来源:https://stackoverflow.com/questions/11747930/dynamic-chart-in-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!