In this short guide, we will learn how to change the figure size with subplots in Python using Matplotlib — one of the most common tasks when building data visualizations for reports, dashboards, or presentations.

1. Why Change Figure Size with Subplots?

When displaying multiple charts side by side, the default figure size is often too small or poorly proportioned. Adjusting the figure size lets you:

  • Prevent charts from overlapping or looking cramped
  • Control how the figure appears in Jupyter notebooks, reports, or exports
  • Match the dimensions required for a specific presentation or article

2. Steps to Change Figure Size with Subplots

Step 1: Import matplotlib.pyplot
Step 2: Use plt.subplots() with the figsize parameter
Step 3: Plot your data on each subplot axis
Step 4: Call plt.tight_layout() to avoid label overlap
Step 5: Display or save the figure

3. Example Data

We'll use monthly revenue data for two companies — Apple and Microsoft — across six months.

months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
apple_revenue    = [120, 135, 128, 150, 162, 175]
microsoft_revenue = [95, 102, 110, 118, 125, 133]

4. Example: Set Figure Size with plt.subplots()

The most direct way to control figure size is through the figsize parameter in plt.subplots(). It accepts a tuple (width, height) in inches.

import matplotlib.pyplot as plt

months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
apple    = [120, 135, 128, 150, 162, 175]
microsoft = [95, 102, 110, 118, 125, 133]

fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 4))
ax1.plot(months, apple, marker="o", color="black")
ax1.set_title("Apple Revenue")
ax2.plot(months, microsoft, marker="s", color="steelblue")
ax2.set_title("Microsoft Revenue")
plt.tight_layout()
plt.savefig("revenue_subplots.png")
plt.show()

Output: Result:

Two side-by-side line charts, each 12 inches wide and 4 inches tall, showing monthly revenue trends for Apple and Microsoft with no label overlap.

5. Explanation of the Code

  • plt.subplots(1, 2, figsize=(12, 4)) — creates a figure with 1 row and 2 columns of subplots; figsize=(12, 4) sets the total figure width to 12 inches and height to 4 inches
  • ax1, ax2 — individual subplot axes you can plot on independently
  • tight_layout() — automatically adjusts spacing so titles and labels don't overlap
  • savefig() — exports the figure to a PNG file

6. Bonus Example: 2×2 Grid with Custom Figure Size

For a 2-row, 2-column grid — useful for quarterly reports comparing multiple companies like Google, Amazon, Meta, and Netflix.

import matplotlib.pyplot as plt

quarters = ["Q1", "Q2", "Q3", "Q4"]
data = {"Google": [80, 90, 85, 100], "Amazon": [70, 75, 80, 95],
        "Meta": [60, 65, 70, 80],   "Netflix": [40, 45, 50, 60]}

fig, axes = plt.subplots(2, 2, figsize=(10, 7))
for ax, (company, values) in zip(axes.flatten(), data.items()):
    ax.bar(quarters, values, color="steelblue")
    ax.set_title(company)
plt.tight_layout()
plt.show()

Output: Result:

A 2×2 grid of bar charts (10 × 7 inches) showing Q1–Q4 revenue for Google, Amazon, Meta, and Netflix — each chart clearly labeled with no crowding.

7. Customization

Goal Code
Wider figure figsize=(16, 5)
Taller figure figsize=(8, 10)
Square subplots figsize=(10, 10)
Add spacing manually plt.subplots_adjust(wspace=0.4, hspace=0.4)
Use figure() separately fig = plt.figure(figsize=(12, 6))

Pro tip: Use plt.subplots_adjust() when tight_layout() still leaves charts too close together — it gives you fine-grained control over horizontal (wspace) and vertical (hspace) spacing.

8. Resources