Ask Your Question

Revision history [back]

From what I understand the Sage Notebook displays a plot if a .png file is created in the directory corresponding to the cell. Thus, plt.savefig('.') also works. Also, be sure to set hold(False) if you want the same behavior as Sage's plot command. Otherwise, your plots will continue to overlap.

Since I use Pylab extensively for numerics, I have a published Sage Notebook here demonstrating plotting in Sage using matplotlib trough Pylab: http://uw.sagenb.org/home/pub/9/. You'll get similar behavior when you use import matplotlib.pyplot instead.

(I would've posted this as a comment to kcrisman's answer above but ASKBOT is giving some strange errors.)