Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change the figure size with subplots?

I came across this example in the Matplotlib website. I was wondering if it was possible to increase the figure size.

I tried with

f.figsize(15,15) 

but it does nothing.

like image 893
Brian Avatar asked Feb 08 '13 10:02

Brian


People also ask

How do I increase subplot size in Matlab?

plot(rand(10),rand(10),'-');

How do I change the space between subplots?

We can use the plt. subplots_adjust() method to change the space between Matplotlib subplots. The parameters wspace and hspace specify the space reserved between Matplotlib subplots. They are the fractions of axis width and height, respectively.


1 Answers

If you already have the figure object use:

f.set_figheight(15) f.set_figwidth(15) 

But if you use the .subplots() command (as in the examples you're showing) to create a new figure you can also use:

f, axs = plt.subplots(2,2,figsize=(15,15)) 
like image 53
Rutger Kassies Avatar answered Sep 19 '22 11:09

Rutger Kassies