matplotlibを用いてヒストグラム(棒グラフ)を作成する。
オプション等についての詳しい説明はここ(英語)にある。
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]# サンプルデータ
fig=plt.figure()
ax=fig.add_subplot(111)
ax.hist(data_lis, range=(0,20),bins=5) # [0,20]の範囲で5等分した棒グラフの作成
plt.show()