How do I change the figure size with subplots?

Brian picture Brian · Feb 8, 2013 · Viewed 647.3k times · Source

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.

Answer

Rutger Kassies picture Rutger Kassies · Feb 8, 2013

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