Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How change sizes of subplots in Matplotlib?

I am using Google Colab and when I try to draw a graph it comes like thisenter image description here

But I have to plot many graphs, so i used a for loop enter image description here

I expected the graphs to be the same size as in the first image but I got all graphs in compressed form. What should I do to obtain the graphs as the same size as in first image using a for loop.

like image 813
SHIVANSHU SAHOO Avatar asked Oct 16 '22 01:10

SHIVANSHU SAHOO


1 Answers

Try to play with figsize parameter:

fig, ax = plt.subplots(no_of_feature, 1, figsize=(5, 10))  # example
like image 191
trsvchn Avatar answered Oct 19 '22 01:10

trsvchn