简体   繁体   English

如何增加 Matplotlib 图的大小?

[英]How to increase the size of a Matplotlib plot?

I made a mosaic plot with Matplotlib, but due to huge number of data points the plot is squeezed,the words overlap with each other.我用 Matplotlib 制作了一个马赛克图,但是由于大量的数据点,该图被压缩了,单词相互重叠。 I want to increase the size of the plot.我想增加情节的大小。 I tried:我试过:

plt.figure(figsize=()) 

It didn't work.它没有用。

Here's my code:这是我的代码:

from statsmodels.graphics.mosaicplot import mosaic
import matplotlib.pyplot as plt

plt.figure(figsize=(200,10)) #does not work
plt.rcParams['font.size'] = 10.0
mosaic(plants_sub, ['Symbol', 'Family'], gap=0.1);

Output:输出:

在此处输入图片说明

添加这个:-

plt.rcParams["figure.figsize"]=(enter your fig width, enter your fig height)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM