Skip to main content

About this free course

Become an OU student

Share this free course

Teaching and learning statistics
Teaching and learning statistics

Start this free course now. Just create an account and sign in. Enrol on the course to track your learning.

3. Histograms

In Week 2 we included these two examples of bar charts, the one on the left showing discrete data and the one on the right showing continuous data.

Figure 9 Bar charts representing discrete and continuous data
Add image here

In the bar chart on the right, the heights are grouped in six classes that have a constant width of 10cm. This graph could be called a histogram. A histogram represents grouped numerical data that has been organised in groups known as class intervals.

Histogram (noun)

A diagram consisting of adjacent vertical rectangles whose area is proportional to the frequency of a variable and whose width is proportional to the class interval.

Histograms are often constructed using constant class intervals, in which case the height of each rectangle is proportional to the frequency of the variable (as in a bar chart). (OED, 2025)

The key words in the definition above are ‘proportional’ and ‘area’; you will see the importance of this when you look at histograms with unequal class intervals. If a histogram has constant class intervals, then the height of each rectangle represents the frequency of the data, and the graph may also be referred to as a grouped bar chart.

Activity 6

Timing: Allow 5 minutes

Here are two graphs representing student results

Intend to put own graphs in here – just included these as example (unless we can use these and just credit them?) Histogram vs Bar Graph in Data Visualization
Figures 10 & 11
Add image here

Write down three similarities and three differences that you notice between the two graphs.

Answer

These are just some examples of what you might have noticed

Similarities • Both show ‘number of students’ on the vertical axis • Both have rectangular bars which are vertical in orientation • Both have rectangular bars of constant width • Both have a horizontal axis giving contextual information and a vertical axis giving a ‘count’ or frequency • They both have an approximately ‘normal’ distribution shape (bell-shaped curve) Differences • One has numbers/discrete data on the horizontal axis, the other has letters/categorical data • The bars are narrower on the graph on the left • One is labelled histogram and the other is a bar graph • There are gaps between the bars on the right-hand graph but no gaps on the left • There appears to be more detailed information in the data represented on the left-hand graph

Which type of graph should I use?

Bar charts are used to show discrete or categorical data i.e. data which falls into categories; recall one of our ‘rules’ from Week 4:

  • the bars should be the same width and separated with gaps (which, again, should be the same width as one another); the length of the bars represents the frequency of occurrences.

In the bar chart in Activity 6, the categorical data being represented is the student result as a grade. Each grade is a category.

Histograms are typically used to show grouped numerical data on the information axis (the horizontal axis).

In the histogram in Activity 6 the grouped numerical data is the student result as a numerical score which appears to have been grouped between numerical boundaries.

There are no gaps between the bars and, visually, the lack of gaps is the main identifying feature.

The vertical axis on a histogram may, or may not, however, directly represent the number of items in each group. Let’s try and unpick this a little more in the next few sections.