【发布时间】:2019-06-29 14:21:46
【问题描述】:
我正在使用 matplotlib.pyplot 绘制直方图,我想增加绘图的大小。要绘制的代码是:
plt.hist(x)
plt.xlabel("Months")
plt.ylabel("Donated")
plt.figure(figsize=(6,4))
plt.show()
但是 plt.figure(..) 对图形的大小没有任何影响。我正在使用 Spyder IDE。
【问题讨论】:
-
先放 plt.figure() 然后放 plt.hist(x)
-
@BryceWayne 成功了,谢谢
-
当然。请记住在绘图之前定义您的空间。
-
请把答案标记为正确。谢谢。
标签: python python-3.x matplotlib