Matplotlib supports the creation of a variety of displays of data. In this recipe, we will demonstrate how to use two popular graphs representing data variability: histograms and box plots (also known as box-and-whisker plots). We will present a comparison between the distribution of heights in the male and female populations. To make the example self-contained, instead of using real data, we will simulate a population with the known distribution of heights for males and females.
Generating histograms and box plots
Getting ready
Start Jupyter and run the following three commands in an execution cell:
%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt