09 Charts
Compare these references after your own attempt. You can read them at any time; they do not record a live model or vendor run.
Compare these references after your own attempt. You can read them at any time; they do not record a live model or vendor run.
# Reference answer. Attempt the exercise first.
# Profile: Charts · Matplotlib
import matplotlib.pyplot as plt
topics = ["Python", "Data", "Charts"]
minutes = [80, 70, 30]
fig, ax = plt.subplots(figsize=(6, 3.5), layout="constrained")
ax.bar(topics, minutes, color=["#2563eb", "#0d9488", "#d97706"])
ax.set(title="Practice time by topic (synthetic sessions)",
xlabel="Topic", ylabel="Minutes", ylim=(0, 90))
ax.spines[["top", "right"]].set_visible(False)
for topic, value in zip(topics, minutes):
ax.text(topic, value + 2, str(value), ha="center")
fig.savefig("practice_minutes.png", dpi=160)
# The lab captures the chart and offers a download. Locally, open the PNG.
# For an interactive local window, optionally call plt.show() afterward.
# Text alternative: Python has 80 minutes, Data 70, Charts 30.
# These synthetic recorded durations do not measure learning gains.