How do you change the size of figure drawn with matplotlib?
Deprecation note:
As per the official Matplotlib guide, usage of thepylab
module is no longer recommended. Please consider using thematplotlib.pyplot
module instead, as described by this other answer.
The following seems to work:
from pylab import rcParams
rcParams['figure.figsize'] = 5, 10
This makes the figure's width 5 inches, and its height 10 inches.
The Figure class then uses this as the default value for one of its arguments.