Bar charts and pie charts · Statistics & Data Science | StemPy Lab
Course 1.2·Lesson 2 of 3
Bar charts and pie charts
A bar chart has one bar for each category, with the height equal to the frequency and gaps between the bars because the categories are separate. A pie chart is a circle cut into slices that show how a whole is shared, and the angle of a slice is the frequency divided by the total times 360 degrees. Use a bar chart to compare categories and a pie chart to show shares of a whole. A good chart has a title, labelled axes and bars that start at zero.
about 30 min1 simulation2 practice questions2 Python programs5 questions to check yourself
This lesson is free to read. Enroll free to keep your place and take the tests.
Lesson 2 of 3Show all lessonsHide
Try the code and the simulations beside the lesson.
The graph for categories
A guide to choosing a graph, with four boxes. A bar chart is for categories, for example favourite sport, and its bars have gaps. A pie chart is for the share of a whole, with slices that add up to 100 percent. A histogram is for numbers in groups, with bars that touch. A line graph is for change over time, for example the temperature each day.
A bar chart has one bar for each category. The height of a bar is its frequency. There are gaps between the bars, because the categories are separate things.
Try it in Python
The pie chart
A pie chart is a circle cut into slices. It shows how a whole is shared. Each slice has an angle:
angle=totalfrequency×360∘
For cricket: 4018×360∘=162∘. For football: 4010×360∘=90∘. For hockey and chess: 54∘ each. The angles add up to 162∘+90∘+54∘+54∘=360∘, which is a good check.
You should find that the three angles always add up to 360∘. Raising one count makes the other two slices smaller, even though their counts stay the same.
Bar or pie?
To compare the categories with each other, use a bar chart. It is easy to see which bar is taller.
To show the share of each category in the whole, use a pie chart. But slices that are nearly equal are hard to compare.
What makes a good chart?
A title that says what the chart shows.
Labels on the axes, with the unit.
Bars that start at zero. If the axis starts higher, a small difference looks very large.
Bars in a sensible order: from the tallest to the shortest, or in the natural order of the categories.
Not too many slices in a pie chart. With more than five or six slices, a bar chart is clearer.
Practise with new numbers
Common mistakes
Using a pie chart for data that is not parts of a whole. The slices must add up to the whole.
Cutting off the bottom of the bars. The height must stand for the value from zero.
Joining the bars of a bar chart. Gaps show that the categories are separate. Touching bars belong to a histogram.
Forgetting the title and the labels. Without them, nobody can tell what the chart shows.
Remember these
A bar chart has one bar for each category, with gaps.
A pie chart: the angle of a slice is its share of 360 degrees.
Give a chart a title, label its axes, and start its bars at zero.
Check yourself
Try each one on your own first. If you are stuck, open a hint. Then check with Show the answer.
What is the angle of a slice that is 25% of the whole?
Do the bars of a bar chart touch?
A class has 12 students who walk, 8 who cycle and 20 who come by bus. What is the angle of the bus slice?
Why can a bar chart whose axis starts at 90, not 0, mislead the reader?
Enroll free in Tables and Graphs
Every lesson is open to read. Enrolling also lets you:
Mark lessons done and carry on where you stopped.
Take the tests of this lesson and its course.
Count the course towards the certificate for its chapter.