箱型图比较复杂,这里只做简要介绍。
声明:
- 需要读者了解Python列表
- 最好了解Python的pandas库
- 教程借助于matplotlib绘图库
箱型图
简单箱型图
boxplot()
import matplotlib.pyplot as plt
fig = plt.figure() # 创建画布
ax = plt.subplot() # 创建作图区域
# 蓝色矩形的红线:50%分位点是4.5,上边沿:25%分位点是2.25,下边沿:75%分位点是6.75
ax.boxplot([range(5), range(10), range(20)])
plt.show()
箱型图的上下限
whis
import matplotlib.pyplot as plt
fig = plt.fi