2

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

smci
  • 32,567
  • 20
  • 113
  • 146
Debbie
  • 911
  • 3
  • 20
  • 45

1 Answers1

12

add this:-

plt.rcParams["figure.figsize"]=(enter your fig width, enter your fig height)
Satish Saini
  • 299
  • 3
  • 9
  • Hi, it worked. Could u plz tell me, Why are the last two bars shifted upward and how to fix it? – Debbie Mar 28 '20 at 08:36