最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

Pyecharts?繪制3種常用的圖形

 更新時間:2022年02月25日 10:32:16   作者:Python數(shù)據(jù)挖掘  
這篇文章主要介紹了Pyecharts?繪制3種常用的圖形,上下組合圖、左右組合圖、一軸多圖,下文繪制過程幾介紹,需要的小伙伴可以參考一下

大家好,今天給大家利用 Pyecharts 繪制上下組合圖、左右組合圖、一軸多圖,好用超經(jīng)典,分析給大家

1.上下組合

from pyecharts.charts import Bar, Line, Grid
from pyecharts import options

# 1、準(zhǔn)備數(shù)據(jù)
country = ['巴西', '俄羅斯', '印度', '英國', '西班牙', '伊朗', '德國', '土耳其', '法國']
quezheng = [923189,553301,354065,298136,244328,192439,188252,181298,157716]
siwang = [45241,7478,11903,41969,27136,9065,8802,4842,29547]

# 2、繪制柱形圖
bar = (
? ? Bar()
? ? .add_xaxis(country)
? ? .add_yaxis("確診人數(shù)", quezheng)
? ? .add_yaxis("死亡人數(shù)", siwang)
? ? .set_global_opts(title_opts=options.TitleOpts(title="我是標(biāo)題", subtitle="我是副標(biāo)題"))
)

# 3、繪制線圖
line = (
? ? Line()
? ? .add_xaxis(country)
? ? .add_yaxis("quzheng人數(shù)", quezheng)
? ? .add_yaxis("siwang人數(shù)", siwang)
? ? .set_global_opts(legend_opts=opts.LegendOpts(pos_bottom="45%"))
)

# 4、創(chuàng)建組合圖
(Grid(init_opts=opts.InitOpts(width='750px', height='350px'))
?.add(bar,grid_opts=opts.GridOpts(pos_bottom="60%"))
?.add(line,grid_opts=opts.GridOpts(pos_top="60%"))
).render_notebook()

結(jié)果如下:

2.左右組合

from pyecharts.charts import Bar, Line, Grid
from pyecharts import options

# 1、準(zhǔn)備數(shù)據(jù)
country = ['巴西', '俄羅斯', '印度', '英國', '西班牙', '伊朗', '德國', '土耳其', '法國']
quezheng = [923189,553301,354065,298136,244328,192439,188252,181298,157716]
siwang = [45241,7478,11903,41969,27136,9065,8802,4842,29547]

# 2、繪制柱形圖
bar = (
? ? Bar()
? ? .add_xaxis(country)
? ? .add_yaxis("確診人數(shù)", quezheng, label_opts=opts.LabelOpts(is_show=False))
? ? .add_yaxis("死亡人數(shù)", siwang, label_opts=opts.LabelOpts(is_show=False))
? ? .set_global_opts(title_opts=options.TitleOpts(title="我是標(biāo)題", subtitle="我是副標(biāo)題"),
? ? ? ? ? ? ? ? ? ? ?legend_opts=opts.LegendOpts(pos_right="20%"))
)

# 3、繪制線圖
line = (
? ? Line()
? ? .add_xaxis(country)
? ? .add_yaxis("quzheng人數(shù)", quezheng, label_opts=opts.LabelOpts(is_show=False))
? ? .add_yaxis("siwang人數(shù)", siwang, label_opts=opts.LabelOpts(is_show=False))
? ? .set_global_opts(legend_opts=opts.LegendOpts(pos_left="20%"))
)

# 4、創(chuàng)建組合圖
(Grid(init_opts=opts.InitOpts(width='750px', height='350px'))
?.add(bar,grid_opts=opts.GridOpts(pos_left="55%"))
?.add(line,grid_opts=opts.GridOpts(pos_right="55%"))
).render_notebook()

結(jié)果如下:

3.一軸多圖

from pyecharts.charts import Bar, Line, Grid
from pyecharts import options

# 1、準(zhǔn)備數(shù)據(jù)
from pyecharts.charts import Bar, Line, Grid
from pyecharts import options

# 1、準(zhǔn)備數(shù)據(jù)
country = ['巴西', '俄羅斯', '印度', '英國', '西班牙', '伊朗', '德國', '土耳其', '法國']
quezheng = [923189,553301,354065,298136,244328,192439,188252,181298,157716]
siwang = [45241,7478,11903,41969,27136,9065,8802,4842,29547]

# 2、繪制柱形圖
bar = (
? ? Bar(init_opts=opts.InitOpts(width='750px', height='350px'))
? ? .add_xaxis(country)
? ? .add_yaxis("確診人數(shù)", quezheng)
? ? .add_yaxis("死亡人數(shù)", siwang)
? ? .set_global_opts(title_opts=options.TitleOpts(title="我是標(biāo)題", subtitle="我是副標(biāo)題"))
)

# 3、繪制線圖
line = (
? ? Line()
? ? .add_xaxis(country)
? ? .add_yaxis("確診人數(shù)", quezheng, label_opts=opts.LabelOpts(is_show=False))
? ? .add_yaxis("死亡人數(shù)", siwang, label_opts=opts.LabelOpts(is_show=False))
)

# 4、創(chuàng)建組合圖
bar.overlap(line).render_notebook()

結(jié)果如下:

到此這篇關(guān)于Pyecharts 繪制3種常用的圖形的文章就介紹到這了,更多相關(guān)Pyecharts 繪制常用的圖形內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

  • Python隨機(jī)生成8位密碼的示例詳解

    Python隨機(jī)生成8位密碼的示例詳解

    這篇文章主要為大家詳細(xì)介紹了基于Python實現(xiàn)隨機(jī)生成8位密碼的相關(guān)方法,文中的示例代碼講解詳細(xì),具有一定的借鑒價值,需要的可以參考一下
    2023-02-02
  • tensorflow識別自己手寫數(shù)字

    tensorflow識別自己手寫數(shù)字

    這篇文章主要為大家詳細(xì)介紹了tensorflow識別自己手寫數(shù)字,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-03-03
  • 使用Python實現(xiàn)跳一跳自動跳躍功能

    使用Python實現(xiàn)跳一跳自動跳躍功能

    這篇文章主要介紹了使用Python實現(xiàn)跳一跳自動跳躍功能,本文圖文并茂通過實例代碼給大家介紹的非常詳細(xì),具有一定的參考借鑒價值,需要的朋友可以參考下
    2019-07-07
  • 在Gnumeric下使用Python腳本操作表格的教程

    在Gnumeric下使用Python腳本操作表格的教程

    這篇文章主要介紹了在Gnumeric下使用Python腳本操作表格的教程,本文來自于IBM官方網(wǎng)站,需要的朋友可以參考下
    2015-04-04
  • python SQLAlchemy 數(shù)據(jù)庫連接池的實現(xiàn)

    python SQLAlchemy 數(shù)據(jù)庫連接池的實現(xiàn)

    SSQLAlchemy提供了強(qiáng)大的連接池和連接管理功能,可以有效地管理數(shù)據(jù)庫連接,本文主要介紹了python SQLAlchemy 數(shù)據(jù)庫連接池的實現(xiàn),具有一定的參考價值,感興趣的可以了解一下
    2025-03-03
  • 用Python3通過PyCharm上傳代碼到Git服務(wù)器的詳細(xì)過程

    用Python3通過PyCharm上傳代碼到Git服務(wù)器的詳細(xì)過程

    上傳代碼到服務(wù)器,如果不知道的情況下還用傳統(tǒng)的方式上傳很麻煩,現(xiàn)在很多IDE都提供上傳代碼的功能,例如:VSCode,PyCharm等等,本文講解的是PyCharm,需要的朋友可以參考下
    2024-03-03
  • 解決Python報錯:ValueError:operands?could?not?be?broadcast?together?with?shapes

    解決Python報錯:ValueError:operands?could?not?be?broadcast?t

    這篇文章主要給大家介紹了關(guān)于解決Python報錯:ValueError:operands?could?not?be?broadcast?together?with?shapes的相關(guān)資料,文中通過實例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2023-02-02
  • python socket實現(xiàn)聊天室

    python socket實現(xiàn)聊天室

    這篇文章主要為大家詳細(xì)介紹了python socket實現(xiàn)聊天室,文中示例代碼介紹的非常詳細(xì),具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2021-07-07
  • 用Python的Django框架來制作一個RSS閱讀器

    用Python的Django框架來制作一個RSS閱讀器

    這篇文章主要介紹了用Python的Django框架來制作一個RSS閱讀器,通過url feeds來制作訂閱類應(yīng)用同樣是Django之所長,需要的朋友可以參考下
    2015-07-07
  • Pytorch之finetune使用詳解

    Pytorch之finetune使用詳解

    今天小編就為大家分享一篇Pytorch之finetune使用詳解,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-01-01

最新評論

务川| 丽水市| 涡阳县| 宜州市| 阿荣旗| 铅山县| 辉南县| 千阳县| 宜昌市| 平遥县| 朝阳县| 惠安县| 沛县| 谷城县| 资中县| 张家口市| 景谷| 鱼台县| 双流县| 宣威市| 安多县| 彭山县| 桑日县| 汤阴县| 上饶市| 乐安县| 慈溪市| 绥德县| 民勤县| 铜川市| 惠安县| 新河县| 梁平县| 靖安县| 东乡族自治县| 竹溪县| 襄汾县| 九龙县| 芜湖市| 阳西县| 漾濞|