import numpy as np import matplotlib.pyplot as plt #generate some random data data = np.random.randn(200) ## 产生200个 标准正态分布数字, d = [data, data] ### 两组一样的数字; list #plot box = plt.boxplot(d, showfliers=False) ## 画盒图 plt.xticks([]) plt.show()
#-----import packages-----# #common python packages import numpy as np import matplotlib.pyplot as plt #generate some random data data1 = np.random.randn(10) ## 产生10个 标准正态分布数字, data2 = np.random.randn(10) data3 = np.random.randn(10) data4 = np.random.randn(10) data5 = np.random.randn(10) d=np.vstack((data1,data2,data3,data4,data5)) print(d.shape) print(d.ndim) #plot box = plt.boxplot(d, showfliers=False) ## 画盒图 plt.xticks([]) plt.show()
(5, 10) 2
标签:10,plt,randn,画盒,Python,random,np,import From: https://www.cnblogs.com/emanlee/p/17087072.html