[IPython-User] Notebook: replot from axis object in subsequent cells

Michael Waskom mwaskom@stanford....
Sat Sep 15 02:17:51 CDT 2012


I'm working on converting some tutorials over from MATLAB into the
Notebook. In these tutorials, frequently there will be some code to
generate a plot, commentary on the plot, and then several small changes and
replots (e.g. adding things in steps, changing the view in 3D plots, etc.)

Is there a way (using the matplotlib object-oriented interface) to replot
an axis object in a subsequent cell, thus avoiding rewriting all of the
common plotting code?  In other words something like:

In [12]: ax = subplot(111);  ax.plot(foo);

In [13]: replot(ax); ax.plot(bar)

Obviously in this toy example it doesn't save much, but for more
complicated plots it could make things much more clean.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/ipython-user/attachments/20120915/9b716a0c/attachment.html 

More information about the IPython-User mailing list