HomeCourseModule 11 › Tiny dashboards with subplots

Tiny dashboards with subplots

Module 11 · Data Visualization8 min readIntermediate

What you'll learn

  • Build a 2×2 grid of charts
  • Share axes appropriately
  • Save the whole thing as one image

The subplots grid

fig, axes = plt.subplots(2, 2, figsize=(10, 7))
ax_a, ax_b = axes[0]
ax_c, ax_d = axes[1]

ax_a.plot(x, y1); ax_a.set_title("Trend")
ax_b.bar(cats, vals); ax_b.set_title("By Category")
ax_c.scatter(x, y2); ax_c.set_title("Scatter")
ax_d.hist(values, bins=20); ax_d.set_title("Distribution")

plt.suptitle("Q1 Dashboard", fontsize=16, fontweight="bold")
plt.tight_layout()
plt.savefig("dashboard.png", dpi=200)

Shared axes

fig, axes = plt.subplots(1, 3, figsize=(12, 4), sharey=True)

Tip: give each panel breathing room

fig.subplots_adjust(hspace=0.4, wspace=0.3)

Key takeaways

  • plt.subplots(rows, cols) gives you a grid of axes.
  • sharey=True aligns scales for fair comparison.
  • One suptitle(), one tight_layout(), save once.

Three-up dashboard

Make a 1×3 dashboard with: monthly revenue line, top-5 product bar, and a distribution histogram. Save as one PNG.

📹 Video walkthrough
A video walkthrough of this lesson will be embedded here. Until then, the written walkthrough above mirrors what the video will cover step-for-step.