1、介绍
bar与barh均为画柱状图所用函数
2、函数介绍
2.1 matplot.pyplot.bar(水平柱状图)
params:
y:放两个列表进去第一个是多少给索引,
第二个是每个索引对应的数值是多少
width:每个柱的长度((固定的情况下该参数不能修改))
height:每个柱的宽度(height与width概念有一点混)
left:横轴的数字的标准化,默认是0
align:对其方式,‘center’, ‘edge’
2.2 matplot.pyplot.bar(竖直柱状图)
params:
参数与barh类似,唯一不同的是
width:每个柱的宽度
height:每个柱的高度(固定的情况下该参数不能修改)
3、例子
4、效果
4.1 bar
4.2 barh