Create a histogram (bar graph) using matplotlib. A detailed explanation of options etc. can be found at here.
import numpy as np
import matplotlib.pyplot as plt
data_lis=[2.4,5.1,1.0,8.0,12.0,22.0,15.0,9.0,12,19.4,21.2,2.3]#Sample data
fig=plt.figure()
ax=fig.add_subplot(111)
ax.hist(data_lis, range=(0,20),bins=5) # [0,20]Creating a bar graph divided into 5 equal parts in the range of
plt.show()