pyechart
官网地址:pyecharts - A Python Echarts Plotting Library built with love.
柱状图:
from pyecharts.charts import Bar from pyecharts import options as opts # 内置主题类型可查看 pyecharts.globals.ThemeType from pyecharts.globals import ThemeType bar = ( Bar(init_opts=opts.InitOpts(theme=ThemeType.LIGHT)) .add_xaxis(["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]) .add_yaxis("商家A", [5, 20, 36, 10, 75, 90]) .add_yaxis("商家B", [15, 6, 45, 20, 35, 66]) .set_global_opts(title_opts=opts.TitleOpts(title="主标题", subtitle="副标题")) )