matplotlib箱线图与柱状图比较

时间:2021-01-25 15:15:04

代码:

 # -*- coding: utf-8 -*-
"""
Created on Thu Jul 12 16:37:47 2018 @author: zhen
""" """
对比箱线图与柱状图
"""
from pylab import *
dataset = [113, 115, 119, 121, 124,
124, 125, 126, 126, 126,
127, 127, 128, 129, 130,
130, 131, 132, 133, 136] subplot(121) boxplot(dataset, vert=False) subplot(122)
hist(dataset) show()

结果:

matplotlib箱线图与柱状图比较