如何使用子图更改图形大小? [英] How do I change the figure size with subplots?
本文介绍了如何使用子图更改图形大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在Matplotlib网站上遇到了此示例.我想知道是否有可能增加图形尺寸.
I came across this example in the Matplotlib website. I was wondering if it was possible to increase the figure size.
我尝试过
f.figsize(15,15)
但它什么也没做.
推荐答案
如果您已经拥有了图形对象,请使用:
If you already have the figure object use:
f.set_figheight(15)
f.set_figwidth(15)
但是,如果您使用.subplots()命令(如您所显示的示例中)来创建新图形,则还可以使用:
But if you use the .subplots() command (as in the examples you're showing) to create a new figure you can also use:
f, axs = plt.subplots(2,2,figsize=(15,15))
这篇关于如何使用子图更改图形大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文