发布时间:2019-09-15 09:57:05编辑:auto阅读(2242)
利用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客户端
49016
48165
38893
36035
30437
27212
26217
21057
20894
19236
90°
123°
106°
780°
848°
832°
840°
804°
763°
914°