- # 直方图主要是运用在定量数据的可视化中,
- # 或者用来进行连续型数据的可视化展示, 主要是展示一种分布特征
- 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()
直方图
来源: http://www.bubuko.com/infodetail-3716898.html