fit matplotlib figure on page
June 14th, 2011 by Lawrence David
occasionally, long figure labels will cause portions of your pylab or matplotlib figure to hang off the page. to change the size of the figure on the page, use the subplots_adjust command:
import pylab as pl
pl.plot()
pl.subplots_adjust(left=.17,bottom=.1,right=.7,top=.82)
UPDATE:
A much easier way of doing this:
fig.tight_layout()