Deprecation note:
As per the official Matplotlib guide, usage of the pylab module is no longer recommended. Please consider using the matplotlib.pyplot module instead, as described by this other answer.
以下方法似乎有效:
from pylab import rcParams
rcParams['figure.figsize'] = 5, 10
figure告诉您调用签名:
figure(figsize=(1,1))
将创建一个逐英寸的图像,它将是80×80像素,除非您还提供了不同的dpi参数。如果已经创建了图形,则可以快速执行以下操作:
要将大小更改传播到现有的gui窗口,请添加
forward=True
以下方法似乎有效:
这使得图形的宽度为5英寸,高度为10英寸。
然后Figure类将此值用作其参数之一的默认值。
相关问题 更多 >
编程相关推荐