Python中的简约实时绘图 [英] Minimalistic Real-Time Plotting in Python
问题描述
我一直在广泛使用python从各种外部设备(从arduinos到示波器)中提取数据,并且我正在寻找一种简单的方法来绘制东西.
I've been using python extensively to extract data from various external pieces of equipment (ranging from arduinos to oscilloscopes), and I'm looking for a simplistic way to plot stuff.
关于堆栈溢出的类似问题已经有了一些答案: wxPython最好的实时绘图小部件是什么?/a>
There's already some answers to similar questions on stack overflow: What is the best real time plotting widget for wxPython?
大多数人都指向Eli Bendersky撰写的这段精美代码http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/
With most pointing to this fine piece of code by Eli Bendersky http://eli.thegreenplace.net/2008/08/01/matplotlib-with-wxpython-guis/
但是代码的范围比我正在寻找的要复杂得多.我正在寻找一些相当简约的东西,它只是在数据从源中流出时实时绘制数据——它不需要 GUI、单选按钮、旋钮和滑块或任何类似的东西.
But the scope of the code is far more complicated that what I'm looking for. I'm looking for something rather minimalistic that just plots the data in real-time as it streams from a source -- it doesn't need a GUI, radio buttons, knobs and sliders, or anything like that.
似乎在循环中调用pylab.plot()或pylab.show()之类的解决方案似乎并没有给出正确的行为.
It seems that solutions such as calling pylab.plot() or pylab.show() in a loop doesn't seem to give the correct behavior.
有人有什么建议吗?
推荐答案
除了您找到的 matplotlib 示例之外,这里还有 wx.lib.plot 和几个答案:
Besides the matplotlib examples you've found, there's also wx.lib.plot and several answers here: http://wxpython-users.1045709.n5.nabble.com/real-time-data-plots-td2344816.html
这篇关于Python中的简约实时绘图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!