简体   繁体   中英

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. 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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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