matplotlib histogram

import matplotlib.pyplot as plt
data = [1.7,1.8,2.0,2.2,2.2,2.3,2.4,2.5,2.5,2.5,2.6,2.6,2.8,
#this histogram has a range from 1 to 4
#and 8 different bins
plt.hist(data, range=(1,4), bins=8)

Here is what the above code is Doing:
1. We’re creating a list of data points.
2. We’re creating a histogram with a range from 1 to 4 and 8 bins.
3. We’re displaying the histogram.