Python框架-pygal之直方图

直方图:

直方图是一个特殊的条,它可以取3个数值:纵坐标高度,横坐标开始和横坐标结束。

import pygal
hist = pygal.Histogram()
hist.add('Wide bars', [(5, 0, 10), (4, 5, 13), (2, 0, 15)])
hist.add('Narrow bars',  [(10, 1, 2), (12, 4, 4.5), (8, 11, 13)])
hist.render_to_file('bar_chart.svg')

原文地址:https://www.cnblogs.com/keqipu/p/7282064.html