直方图

#直方图主要是运用在定量数据的可视化中,
#或者用来进行连续型数据的可视化展示,主要是展示一种分布特征

import matplotlib.pyplot as plt
import numpy as np
x=np.random.randint(0,100,100)
bins=range(0,101,10)
plt.hist(x,bins=bins,histtype="bar",rwidth=10)
plt.xlabel("scores")
plt.ylabel("number")
plt.show()


原文地址:https://www.cnblogs.com/shunguo/p/14288403.html