绘制直方图

import  numpy
from  matplotlib  import  pyplot
n=12
x=numpy.arange(12)
y1=(1-x/float(n))*numpy.random.uniform(0.5,1.0,n)
y2=(1-x/float(n))*numpy.random.uniform(0.5,1.0,n)

pyplot.bar(x,y1,color='pink',edgecolor='black')
pyplot.bar(x,-y2,color='pink',edgecolor='black')



pyplot.xticks(())      #去除刻度
pyplot.yticks(())      #除去刻度
pyplot.show()

原文地址:https://www.cnblogs.com/luckiness/p/13170401.html