Histograms

Understanding Data Visualization

Richie Cotton

Data Evangelist at DataCamp

When should you use a histogram?

  1. If you have a single continuous variable.
  2. You want to ask questions about the shape of its distribution.
Understanding Data Visualization

Kings and Queens of England & Britain

official_name house birth_date start_of_rule age_at_start_of_rule
Charles III Windsor 1948-11-14 2022-09-08 73.86575
Elizabeth II Windsor 1926-04-21 1952-02-06 25.79603
George VI Windsor 1895-12-14 1936-12-11 40.99110
Edward VIII Windsor 1894-06-23 1936-01-20 41.57426
... ... ... ... ...
Eadred Wessex 0923-07-01 0946-05-26 22.90212
Edmund I Wessex 0921-07-01 0939-10-27 18.32170
Aethelstan Wessex 0894-07-01 0924-07-01 29.99863
Understanding Data Visualization

Histogram of age at start of rule

Histogram of the age of ascension of English and British monarchs.

Understanding Data Visualization

Choosing binwidth: 1 year

Histogram of the age of ascension of English and British monarchs, with a binwidth of 1 year.

Understanding Data Visualization

Choosing binwidth: 25 years

Histogram of the age of ascension of English and British monarchs, with a binwidth of 25 years.

Understanding Data Visualization

Modality: how many peaks?

Histograms displaying unimodal, bimodal, and trimodal distributions, with one, two, and three peaks respectively.

Understanding Data Visualization

Modality: how many peaks?

Histogram of the age of ascension of English and British monarchs.

Histograms displaying unimodal, bimodal, and trimodal distributions, with one, two, and three peaks respectively.

Understanding Data Visualization

Skewness: is it symmetric?

Histograms displaying left-skewed, symmetric, and right-skewed distributions.

Understanding Data Visualization

Skewness: is it symmetric?

Histogram of the age of ascension of English and British monarchs.

Histograms displaying left-skewed, symmetric, and right-skewed distributions.

Understanding Data Visualization

Kurtosis: how many extreme values?

Histograms displaying leptokurtic, mesokurtic, and platykurtic distributions.

Understanding Data Visualization

Kurtosis: how many extreme values?

Histogram of the age of ascension of English and British monarchs.

Histograms displaying leptokurtic, mesokurtic, and platykurtic distributions.

Understanding Data Visualization

Let's practice!

Understanding Data Visualization

Preparing Video For Download...