Lesson 7 of 10

Bar Charts & Histograms 📊

🎯 Grades 6–8 ⏱ ~30 minutes 💚 Intermediate

What You'll Learn

  • Know when to use a bar chart vs. a histogram
  • Create bar charts with plt.bar()
  • Create histograms with plt.hist()
  • Customise colours and bin counts

🎉 Check Your Understanding

1. Which chart type is best for comparing test scores across subjects (Math, Science, English)?

Bar chart
Histogram
Line chart
Scatter plot

2. What does the bins parameter control in plt.hist()?

The colour of the bars
How many groups the data is divided into
The height of the tallest bar
The width of the chart

3. In plt.bar(categories, values), what goes in the first argument?

The numerical heights of the bars
The category labels for the x-axis
The chart title
The colour

4. A histogram is used to show ___.

Change over time
Relationship between two variables
Distribution of a single numerical variable
Comparison of categories