您好,登录后才能下订单哦!
密码登录
登录注册
点击 登录注册 即表示同意《亿速云用户服务条款》
这篇文章主要讲解了“python pyecharts柱形图怎么实现”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“python pyecharts柱形图怎么实现”吧!
from pyecharts.charts import Bar
import pyecharts.options as opts
num = [23, 85, 72, 43, 52]
lab = ['A','B','C','D','E']
(
Bar(init_opts=opts.InitOpts(width='720px', height='320px'))
.add_xaxis(xaxis_data=lab)
.add_yaxis(series_name='' ,yaxis_data=num)
.set_global_opts(
title_opts=opts.TitleOpts(title='主标题', subtitle='副标题')
)
).render_notebook()
from pyecharts.charts import Bar
import pyecharts.options as opts
num = [23, 85, 72, 43, 52]
num2 = [14, 35, 62, 41, 19]
lab = ['A','B','C','D','E']
(
Bar(init_opts=opts.InitOpts(width='720px', height='320px'))
.add_xaxis(xaxis_data=lab)
.add_yaxis(series_name='one', yaxis_data=num)
.add_yaxis(series_name='two', yaxis_data=num2)
.set_global_opts(
title_opts=opts.TitleOpts(title='主标题', subtitle='副标题')
)
).render_notebook()
from pyecharts.charts import Bar
import pyecharts.options as opts
num = [23, 85, 72, 43, 52]
num2 = [14, 35, 62, 41, 19]
lab = ['A','B','C','D','E']
(
Bar(init_opts=opts.InitOpts(width='720px', height='320px'))
.add_xaxis(xaxis_data=lab)
.add_yaxis(series_name='one', yaxis_data=num, stack="stack1")
.add_yaxis(series_name='two', yaxis_data=num2, stack="stack1")
.set_global_opts(
title_opts=opts.TitleOpts(title='主标题', subtitle='副标题')
)
).render_notebook()
from pyecharts import options as opts
from pyecharts.charts import Bar
num = [23, 85, 72, 43, 52]
num2 = [14, 35, 62, 41, 19]
lab = ['A','B','C','D','E']
(
Bar()
.add_xaxis(lab)
.add_yaxis("one", num)
.add_yaxis("two", num2)
.reversal_axis()
.set_series_opts(label_opts=opts.LabelOpts(position="right"))
.set_global_opts(title_opts=opts.TitleOpts(title="Bar-翻转 XY 轴"))
).render_notebook()
感谢各位的阅读,以上就是“python pyecharts柱形图怎么实现”的内容了,经过本文的学习后,相信大家对python pyecharts柱形图怎么实现这一问题有了更深刻的体会,具体使用情况还需要大家实践验证。这里是亿速云,小编将为大家推送更多相关知识点的文章,欢迎关注!
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。