- 美国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()
![在这里插入图片描述](https://img-blog.csdnimg.cn/20200605004154561.png?x-oss-process=image/watermark,type_ZmFuZ3poZW5naGVpdGk,shadow_10,text_aHR0cHM6Ly9ibG9nLmNzZG4ubmV0L20wXzQ1MTI2NDA5,size_16,color_FFFFFF,t_70)
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