[IPython-dev] interactive matplotlib via comm infrastructure

Jason Grout jason-sage at creativetrax.com
Fri Nov 15 09:07:39 EST 2013

I should probably have cross-posted this: 

Following a very helpful conversation with Michael yesterday in the
dev hangout, I got the interactive matplotlib working with the current 
master (of matplotlib and ipython).

I updated the pull request at

To test this, run IPython (master branch, to get the comm commits), and
put this in a cell:

Then you can execute something like:

from matplotlib.figure import Figure
import numpy as np
fig = Figure()
a = fig.add_subplot(111)
t = np.arange(0.0, 3.0, 0.01)
s = np.sin(2 * np.pi * t)
a.plot(t, s)

and get a live figure in the IPython notebook that uses the comm
messaging infrastructure.

I also got this working in the Sage cell server:

http://sagecell.sagemath.org/?q=ilpajg (for a sage plotting example)

http://sagecell.sagemath.org/?q=spadja (for one of the examples from the
matplotlib docs)

Thanks again for everyone's work on the comm infrastructure!


More information about the IPython-dev mailing list