BuildlyBuildly
DashboardExercisesProfileHelp
Back to all

Practice: Matplotlib Customization

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
    Title and Label a Chart
    Context. A chart without a title or axis labels is a guessing game. This week's temperatures need a chart someone else can read. Your task. Write make_labeled_chart(days, temps) that plots temperature over days as a line, sets a title mentioning "Temperature", labels both axes, and returns the axes. Example. Title "Daily Temperature", x-label "Day", y-label "Temperature (C)". Notes. The title just has to contain the word Temperature — the exact wording is up to you. Both axis labels must be non-empty.
    7 min· 10 XP
  • 2
    Add a Legend
    Context. Online and in-store sales share one chart. Without a legend nobody knows which line is which. Your task. Write make_legend_chart(months, online, store) that plots two lines — online labeled "Online", store labeled "Store" (in that order) — adds a legend, and returns the axes. Example. Pass label="Online" to the first plot call, then ax.legend() picks the labels up. Notes. Plot Online first, Store second — the legend order follows plotting order. Labels are case-sensitive.
    7 min· 10 XP
  • 3
    Style the Sales Line
    Context. The monthly sales line is going on a slide and the brand color is red. Styling is part of the job. Your task. Write make_styled_line(months, sales) that plots sales as a red line, sets a title mentioning "Sales", and returns the axes. Example. color="red" in the plot call; title like "Monthly Sales". Notes. Use the color name "red" exactly (not a hex code) — the checker reads back the color you set.
    7 min· 10 XP