BuildlyBuildly
DashboardExercisesProfileHelp
Back to all

Practice: Subplots

Drills tagged with this skill, unpassed first. Pass them all to mark the skill ready for scenarios.

Module 4: Data Visualization

0/3 done
Exercises (0/3)
  • 1
    A Two-Panel Figure
    Context. Revenue and orders belong side by side — one figure, two panels, so the reader compares without scrolling. Your task. Write make_grid(revenue, orders) that creates a 1×2 grid with plt.subplots(1, 2), plots revenue as a line in the left panel and orders as a line in the right panel, and returns both fig, axes. Example. fig, axes = plt.subplots(1, 2) — then axes[0] is the left panel, axes[1] the right. Notes. Return the pair: return fig, axes. One line per panel.
    7 min· 10 XP
  • 2
    Line and Bars Side by Side
    Context. A mini-dashboard: the monthly revenue trend on the left, a regional comparison on the right. Different chart types, one figure. Your task. Write make_dashboard(months, revenue, regions, region_sales) — a 1×2 grid with a revenue line in the left panel and one bar per region in the right panel. Return fig, axes. Example. axes[0].plot(...) for the trend, axes[1].bar(...) for the regions. Notes. Each panel has its own plotting methods — nothing is shared between them.
    7 min· 10 XP
  • 3
    Title Every Panel
    Context. Two untitled panels force the reader to guess. Each panel gets its own title. Your task. Write make_titled_grid(revenue, orders) — a 1×2 grid, revenue line left titled exactly "Revenue", orders line right titled exactly "Orders". Return fig, axes. Example. axes[0].set_title("Revenue") titles just the left panel. Notes. Panel titles are set on each axes, not on the figure. Exact spelling matters here.
    7 min· 10 XP