如何更改用matplotlib绘制的图形的大小?
转载于:https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-drawn-with-matplotlib
如何更改用matplotlib绘制的图形的大小?
转载于:https://stackoverflow.com/questions/332289/how-do-you-change-the-size-of-figures-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.