Problem solved: add 'bbox_inches="tight"
argument to savefig.
import matplotlib.pyplot as plt
fig = plt.figure()
ax = fig.add_axes([1,1,1,1])
plt.plot([1,2])
savefig('test.png', bbox_inches="tight")
I don’t understand what’s happening here, but the file looks like the iPython notebook inline file now. Yay.