import matplotlib matplotlib.use("pdf") from pylab import * plot([1,2,3]) savefig("test")