BuildlyBuildly
DashboardExercisesProfileHelp
Back to all

Practice: Matplotlib Basics

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
    Plot a Revenue Trend
    Context. Six months of revenue numbers are sitting in a list. A line chart makes the trend obvious at a glance. Your task. Write make_line_chart(months, revenue) that creates a figure, draws revenue over months as a line, and returns the axes. Example. fig, ax = plt.subplots() gives you a figure and axes; the line goes on the axes. Notes. Return ax, not fig. One line only — don't add extra plots.
    7 min· 10 XP
  • 2
    Bar Chart of Category Sales
    Context. Four product categories, four sales totals. Bars are the natural way to compare categories side by side. Your task. Write make_bar_chart(categories, sales) that draws one bar per category with its sales as the height, and returns the axes. Example. Toys gets a bar of height 500, Books one of height 320, and so on. Notes. Keep the categories in the order given. Return ax.
    7 min· 10 XP
  • 3
    Scatter Hours vs Scores
    Context. Eight students, their study hours and their test scores. A scatter plot shows whether the two move together. Your task. Write make_scatter(hours, scores) that draws one dot per (hours, scores) pair and returns the axes. Example. The student with 1 hour and score 52 becomes the dot at (1, 52). Notes. Use a scatter, not a line — dots live in ax.collections, not ax.lines.
    7 min· 10 XP