Python Matplotlib画图示例

来源:互联网 发布:网络通信设备品牌排行 编辑:程序博客网 时间:2024/05/17 09:32
import numpyimport matplotlib.pyplot as pyplotdef draw_fig():    count = 100    xArr = [i for i in range(count)]    yArr = numpy.random.random(count)    pyplot.axes(xlim=(0, count), ylim=(0, 1))    pyplot.plot(xArr, yArr, color="b")    pyplot.xlabel("x")    pyplot.ylabel("y")    pyplot.savefig("myfig.png")    pyplot.clf()
0 0