Fork me on GitHub

用matplotlib包画箱型图

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#箱型图
#author:victor

#import module
import numpy as np
import matplotlib.pyplot as plt

#normal distribution
data=np.random.normal(loc=0,scale=1,size=1000)

#sym点的形状,whis虚线的长度
plt.boxplot(data,sym='o',whis=1.5)

#display the graph
plt.show()

box