代码:

 1 # -*- coding: utf-8 -*-
 2 """
 3 Created on Thu Jul 12 16:37:47 2018
 4 
 5 @author: zhen
 6 """
 7 
 8 """
 9     对比箱线图与柱状图
10 """
11 from pylab import *
12 dataset = [113, 115, 119, 121, 124,
13            124, 125, 126, 126, 126,
14            127, 127, 128, 129, 130,
15            130, 131, 132, 133, 136]
16 
17 subplot(121)
18 
19 boxplot(dataset, vert=False)
20 
21 subplot(122)
22 hist(dataset)
23 
24 show()

结果:

matplotlib箱线图与柱状图比较

 

相关文章:

  • 2021-08-26
  • 2022-12-23
  • 2021-09-20
  • 2021-11-22
  • 2021-10-14
  • 2022-12-23
  • 2021-12-25
  • 2021-07-21
猜你喜欢
  • 2021-05-18
  • 2022-02-12
  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2021-10-20
  • 2021-06-21
相关资源
相似解决方案