我目前正在评估不同的python绘图库.现在我正在尝试使用matplotlib,我对性能非常失望.以下示例是从SciPy示例中修改的,并且每秒仅给出~8帧!
有什么方法可以加快速度,或者我应该选择不同的绘图库?
from pylab import *
import time
ion()
fig = figure()
ax1 = fig.add_subplot(611)
ax2 = fig.add_subplot(612)
ax3 = fig.add_subplot(613)
ax4 = fig.add_subplot(614)
ax5 = fig.add_subplot(615)
ax6 = fig.add_subplot(616)
x = arange(0,2*pi,0.01)
y = sin(x)
line1, = ax1.plot(x, y, 'r-')
line2, = ax2.plot(x, y, 'g-')
line3, = ax3.plot(x, y, 'y-')
line4, = ax4.plot(x, y, 'm-')
line5, = ax5.plot(x, y, 'k-')
line6, = ax6.plot(x, y, 'p-')
# turn off interactive plotting - speeds things up by 1 Frame …Run Code Online (Sandbox Code Playgroud) 我正在尝试找到一种用于绘制数据的工具(主要是线图等),可用于高性能应用程序.我的数据窗口通常包含500到几千个点,我对帧率为10左右感到满意.我在套接字上以二进制流的形式接收数据.我在Mac OS X上.
我尝试了几种解决方案,并在下面讨论我的经验.
R:非常慢,无法跟上,读取插座很痛苦,图形闪烁.
matplotlib:非常慢但有点可用.但是,它需要运行大量的Python机器,而IMO的API非常不透明.在不断更新的情况下,包含图形的窗口变为模态,并且出现Mac沙滩球 - 对用户交互不太好.
Gnuplot:更好的性能和API.(!),但通信大量的数据来的gnuplot通过生成临时ASCII文件发生-这意味着,如果我的帧率上升,我开始做顿磁盘读取,这是一个性能问题.
还有其他建议吗?