我目前正在评估不同的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) 我正在尝试制作散点图的动画,其中点的颜色和大小在动画的不同阶段发生变化.对于数据,我有两个numpy ndarray,x值和y值:
data.shape = (ntime, npoint)
x.shape = (npoint)
y.shape = (npoint)
Run Code Online (Sandbox Code Playgroud)
现在我想绘制一个类型的散点图
pylab.scatter(x,y,c=data[i,:])
Run Code Online (Sandbox Code Playgroud)
并在索引上创建一个动画i.我该怎么做呢?