How to increase the size of a Matplotlib plot?

10.1k Views Asked by At

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:

enter image description here

1

There are 1 best solutions below

1
On BEST ANSWER

add this:-

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