发布时间:2019-09-15 09:57:05编辑:auto阅读(2202)
利用python生成曲线图像的脚本,参考自:http://www.lorenzogil.com/projects/pycha/
- import cairo
- import pycha.bar
- width,height=500,400
- surface=cairo.ImageSurface(cairo.FORMAT_ARGB32,width,height)
- dataSet=(
- ('dateset1',((0,1),(1,3),(2,2.5))),
- ('dateset2',((0,2),(1,4),(2,3))),
- ('dateset3',((0,5),(1,1,),(2,0.5))),
- )
- options={
- 'legend':{'hide':False},
- 'background':{'color': '#f0f0f0'},
- }
- chart=pycha.bar.VerticalBarChart(surface,options)
- chart.addDataset(dataSet)
- chart.render()
- surface.write_to_png('test.png')
效果图:
上一篇: python 实现 自动 svn che
下一篇: 安装金碟K3客户端
48726
47764
38535
35731
30169
26909
25937
20782
20547
18938
325°
401°
436°
455°
442°
433°
484°
555°
667°
682°