欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

詳解如何基于Pyecharts繪制常見的直角坐標系圖表

 更新時間:2022年04月27日 16:13:19   作者:小黃同學(xué)AC  
pyecharts是基于前端可視化框架echarts的Python可視化庫,下面這篇文章主要給大家介紹了關(guān)于如何基于Pyecharts繪制常見的直角坐標系圖表的相關(guān)資料,文中通過實例代碼介紹的非常詳細,需要的朋友可以參考下

1.直方圖

# -*-coding:utf-8 -*-
# @Time :  21:02
# @Author: 黃榮津
# @File : 1.直方圖.py
# @Software: PyCharm
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
 
x_data = ['python', 'java', 'c','c++', 'R', 'excel']
y_data = [143, 123, 69, 107, 90, 73]
bar = (Bar()
       .add_xaxis(x_data)
       .add_yaxis('', y_data)
      )
bar.render("1.直方圖.html")

2.折線圖

# -*-coding:utf-8 -*-
# @Time :  21:19
# @Author: 黃榮津
# @File : 2.折線圖.py
# @Software: PyCharm
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
 
x_data = ['python', 'java', 'c','c++', 'R', 'excel']
y_data = [143, 123, 69, 107, 90, 73]
line = (Line()
       .add_xaxis(x_data)
       .add_yaxis('', y_data)
      )
line.render("2.折線圖.html")

3.箱形圖

# -*-coding:utf-8 -*-
# @Time :  21:25
# @Author: 黃榮津
# @File : 3.箱型圖.py
# @Software: PyCharm
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
 
x_data = ['python', 'java', 'c','c++', 'R', 'excel']
y_data = [[random.randint(100, 150) for i in range(20)] for item in x_data]
 
class Box:
    pass
 
box =( Boxplot()
.add_xaxis(x_data)
.add_yaxis("", (y_data))
)
box.render("3.箱型圖.html")

4.散點圖

# -*-coding:utf-8 -*-
# @Time :  21:58
# @Author: 黃榮津
# @File : 4.散點圖.py
# @Software: PyCharm
 
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
x_data = ['python', 'java', 'c','c++', 'R', 'excel']
y_data = [143, 123, 69, 107, 90, 73]
Scatter=(Scatter()
       .add_xaxis(x_data)
       .add_yaxis('', y_data)
      )
Scatter.render("4.散點圖.html")

5.帶漣漪效果散點圖

# -*-coding:utf-8 -*-
# @Time :  22:23
# @Author: 黃榮津
# @File : 5.帶漣漪效果散點圖.py
# @Software: PyCharm
 
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
x_data = ['python', 'java', 'c','c++', 'R', 'excel']
y_data = [143, 123, 69, 107, 90, 73]
 
effectScatter = (EffectScatter()
           .add_xaxis(x_data)
           .add_yaxis('', y_data)
           )
 
effectScatter.render("5.帶漣漪效果散點圖.html")

6.k線圖

# -*-coding:utf-8 -*-
# @Time :  22:27
# @Author: 黃榮津
# @File : 6.k線圖.py
# @Software: PyCharm
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
 
date_list = ["2022/4/{}".format(i + 1) for i in range(30)]
y_data = [[random.randint(200, 350) for i in range(20)] for item in date_list]
 
kline = (Kline()
         .add_xaxis(date_list)
         .add_yaxis('', y_data)
         )
 
kline.render("6.k線圖.html")

7.熱力圖

# -*-coding:utf-8 -*-
# @Time :  22:36
# @Author: 黃榮津
# @File : 7.熱力圖.py
# @Software: PyCharm
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
 
data = [[i, j, random.randint(0, 100)] for i in range(24) for j in range(7)]
hour_list = [str(i) for i in range(24)]
week_list = ['周日', '周一', '周二', '周三', '周四', '周五', '周六']
 
heat = (HeatMap()
        .add_xaxis(hour_list)
        .add_yaxis("", week_list, data)
        )
 
heat.render("7.熱力圖.html")

8.象型圖

# -*-coding:utf-8 -*-
# @Time :  22:46
# @Author: 黃榮津
# @File : 8.象型圖.py
# @Software: PyCharm
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
 
x_data = ['python', 'java', 'c','c++', 'R', 'excel']
y_data = [143, 123, 69, 107, 90, 33]
pictorialBar = (PictorialBar()
                .add_xaxis(x_data)
                .add_yaxis('', y_data)
                )
 
pictorialBar.render("8.象型圖.html")

9.層疊圖

# -*-coding:utf-8 -*-
# @Time :  23:02
# @Author: 黃榮津
# @File : 9.層疊圖.py
# @Software: PyCharm
 
from pyecharts.charts import *
from pyecharts.components import Table
from pyecharts import options as opts
from pyecharts.commons.utils import JsCode
import random
import datetime
from pyecharts.globals import CurrentConfig
CurrentConfig.ONLINE_HOST = "https://cdn.kesci.com/lib/pyecharts_assets/"
 
x_data = ['python', 'java', 'c','c++', 'R', 'excel']
y_data = [143, 123, 69, 107, 90, 73]
bar = (Bar()
       .add_xaxis(x_data)
       .add_yaxis('', y_data)
       )
 
line = (Line()
        .add_xaxis(x_data)
        .add_yaxis('', y_data)
        )
 
overlap = bar.overlap(line) #利用第一個圖表為基礎(chǔ),往后的數(shù)據(jù)都將會畫在第一個圖表上
overlap.render("9.層疊圖.html")

總結(jié)

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

相關(guān)文章

  • 打開并讀取npy文件,查看文件內(nèi)容方式

    打開并讀取npy文件,查看文件內(nèi)容方式

    這篇文章主要介紹了打開并讀取npy文件,查看文件內(nèi)容方式,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教
    2024-02-02
  • python中取整數(shù)的幾種方法

    python中取整數(shù)的幾種方法

    這篇文章主要給大家分享python中取整數(shù)的幾種方法技巧,文章將圍繞python取整數(shù)的詳細的相關(guān)資料展開內(nèi)容,需要的朋友可以參考一下,希望對你有所幫助
    2021-11-11
  • TensorFlow實現(xiàn)Batch Normalization

    TensorFlow實現(xiàn)Batch Normalization

    這篇文章主要為大家詳細介紹了TensorFlow實現(xiàn)Batch Normalization,具有一定的參考價值,感興趣的小伙伴們可以參考一下
    2018-03-03
  • Python利用wxPython制作股票價格查詢工具

    Python利用wxPython制作股票價格查詢工具

    在當(dāng)今信息時代,金融市場是一個引人注目的話題。本文將介紹如何使用 Yahoo Finance API、yfinance 模塊和 wxPython 庫來創(chuàng)建一個簡單的全球股市實時價格查詢工具,希望大家能夠喜歡
    2023-05-05
  • Python模塊glob函數(shù)示例詳解教程

    Python模塊glob函數(shù)示例詳解教程

    這篇文章主要介紹了Python模塊glob函數(shù)的示例詳解教程,有需要的朋友可以借鑒參考下,希望能夠有所幫助,祝大家多多進步,早日升職加薪
    2021-10-10
  • python xpath獲取頁面注釋的方法

    python xpath獲取頁面注釋的方法

    今天小編就為大家分享一篇python xpath獲取頁面注釋的方法,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2019-01-01
  • Python上下文管理器深入講解

    Python上下文管理器深入講解

    Python有三大神器,一個是裝飾器,一個是迭代器、生成器,最后一個就是今天文章的主角 -- 「上下文管理器」。上下文管理器在日常開發(fā)中的作用是非常大的,可能有些人用到了也沒有意識到這一點
    2022-12-12
  • pyCharm 實現(xiàn)關(guān)閉代碼檢查

    pyCharm 實現(xiàn)關(guān)閉代碼檢查

    這篇文章主要介紹了pyCharm 實現(xiàn)關(guān)閉代碼檢查,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧
    2020-06-06
  • Python實現(xiàn)字符串逆序輸出功能示例

    Python實現(xiàn)字符串逆序輸出功能示例

    這篇文章主要介紹了Python實現(xiàn)字符串逆序輸出功能,結(jié)合具體實例形式分析了Python針對字符串的遍歷、翻轉(zhuǎn)、排序等相關(guān)操作技巧,需要的朋友可以參考下
    2017-06-06
  • 下載糗事百科的內(nèi)容_python版

    下載糗事百科的內(nèi)容_python版

    代碼是沒問題的,可以正常運行,但是希望做到以下2方面: 1、多線程下載 2、代碼分離度更高,跟面向?qū)ο?
    2008-12-12

最新評論