1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
| ''' #!/usr/bin/env python # -*- coding:utf-8 -*- # Created by victor # Created Time: '2020/2/14 23:34' 本节课我们画箱型图 箱型图又称之为盒须图,盒式图或者箱线图 是一种用作显示一组数据分散情况资料的统计图 上边缘,上四分位数,中位数,下四分位数,下边缘,异常值 '''
import numpy as np import matplotlib.pyplot as plt
a = [42,55,79,68,15,98] b = [32,59,77,100,92,88,5,0] c = [92,98,78,65,97,100,0]
plt.boxplot( (a,c,b), labels = ('a','c','b'),
showfliers = True, whis = 1.5, showmeans = True, meanline = True,
widths = 0.5,
vert = True, patch_artist = True, boxprops = {'facecolor':'#ffff00','color':'green'}, )
plt.grid(linewidth=0.2) plt.show()
|