Most lightweight way to plot streaming data in python
Question: To give you a sense of what I'm looking for, it looks like
[this](http://youtu.be/xMWIATas_e0?t=1m37s):

Up until now I have used matplotlib for all my plotting, and timing hasn't
been critical (it's been done in postprocessing).

I'm wondering if there is a lighter weight way to plot other than shifting my
data to the left and redrawing the entire plot.


Answer: Have a look at the [Matplotlib Animations
Examples](http://www.scipy.org/Cookbook/Matplotlib/Animations). The main trick
is to not completely redraw the graph but rather use the OO interface of
matplotlib and set the x/ydata of the plot-line you created. If you've
integrated your plot with some GUI, e.g., GTK, then definitely do it like
proposed in the respective section of the plot, otherwise you might interfere
with the event-loop of your GUI toolkit.

For reference, if the link ever dies:

    
    
    from pylab import *
    import time
    
    ion()
    
    tstart = time.time()               # for profiling
    x = arange(0,2*pi,0.01)            # x-array
    line, = plot(x,sin(x))
    for i in arange(1,200):
        line.set_ydata(sin(x+i/10.0))  # update the data
        draw()                         # redraw the canvas
    
    print 'FPS:' , 200/(time.time()-tstart)
    

