Interactive Matplotlib

Normally, matplotlib will not show plots until you call However, if you call pylab.ion() before plotting, matplotlib will show the window immediately. For best results, decorate (set title, axis labels, etc) after calling pylab.plot() or pylab.hist(). You should still call at the end of your code, otherwise python will not wait for you to close the graph windows before exiting.

Example code:

import pylab
import visual
xs = []
ys = []
for x in range(10):
    pylab.plot(xs, ys, 'b-o')
cs190c/interactive_matplotlib.txt · Last modified: 2008/02/29 10:34 by smittal
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki