ion()
tstart = time.time()
x = arange(0, 2 * pi, 0.01)
line, = plot(x, sin(x))
for i in arange(1, 200):
    line.set_ydata(sin(x + i / 10.0))
draw()
print('FPS:', 200 / (time.time() - tstart))
Most lightweight way to plot streaming data in python