[ How do I set the size of the axes patch so that the plot labels aren't clipped (matplotlib) ]
I have a graph in which I've set the axis labels to scientific notation using
formatter = mpl.ticker.FormatStrFormatter('%4.2e')
However, the axes.patch (or whatever is the right way to express the 'canvas' extent of the plot) doesn't adjust so the tick labels and axis label are clipped:
How do I adjust the extent of the axes portion of the plot. Changing the page size (figsize = ...) doesn't do it, since that just scales the overall plot area, resulting in the same clipping problem.
You can use the method
tight_layout, which will accommodate the plot in the figure available space.
from pylab import * f = figure() f.add_subplot(111) f.tight_layout() show()
Hope it helps.
fig.tight_layout() (assuming you have a Figure object defined).