运用Pyecharts绘制基本图形

  1. 美国1995年-2009年邮费变化折线图、阶梯图;
    数据如下:
    年份 : [“1995”, “1996”, “1997”, “1998”, “1999”, “2000”,
    “2001”, “2002”, “2003”, “2004”, “2005”, “2006”,
    “2007”, “2008”, “2009”]
    邮费: [0.32, 0.32, 0.32, 0.32, 0.33, 0.33, 0.34, 0.37, 0.37, 0.37, 0.37, 0.39, 0.41, 0.42, 0.44]
from pyecharts.charts import Line
import pyecharts.options as opts
year=["1995", "1996", "1997", "1998", "1999", "2000","2001", "2002", "2003", "2004", "2005", "2006","2007", "2008", "2009"]
postage=[0.32, 0.32, 0.32, 0.32, 0.33, 0.33, 0.34, 0.37, 0.37, 0.37, 0.37, 0.39, 0.41, 0.42, 0.44]

line1=(Line(init_opts=opts.InitOpts(width='720px',height='320px')) 
     .add_xaxis(xaxis_data=year)
     .add_yaxis(series_name='',y_axis=postage)
     .set_global_opts(title_opts=opts.TitleOpts(title='美国1995年-2009年邮费变化折线图'))
     )
line1.render('美国1995年-2009年邮费变化折线图.html') # 在当前目录下存为html文件
line1.render_notebook()

在这里插入图片描述

from pyecharts.charts import Line
import pyecharts.options as opts
year=["1995", "1996", "1997", "1998", "1999", "2000","2001", "2002", "2003", "2004", "2005", "2006","2007", "2008
  • 1
    点赞
  • 15
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值