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

詳解如何基于Pyecharts繪制常見的直角坐標(biāo)系圖表

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

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.散點(diǎn)圖

# -*-coding:utf-8 -*-
# @Time :  21:58
# @Author: 黃榮津
# @File : 4.散點(diǎn)圖.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.散點(diǎn)圖.html")

5.帶漣漪效果散點(diǎn)圖

# -*-coding:utf-8 -*-
# @Time :  22:23
# @Author: 黃榮津
# @File : 5.帶漣漪效果散點(diǎn)圖.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.帶漣漪效果散點(diǎn)圖.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) #利用第一個(gè)圖表為基礎(chǔ),往后的數(shù)據(jù)都將會(huì)畫在第一個(gè)圖表上
overlap.render("9.層疊圖.html")

總結(jié)

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

相關(guān)文章

  • 使用Python實(shí)現(xiàn)為PDF文檔設(shè)置和移除密碼

    使用Python實(shí)現(xiàn)為PDF文檔設(shè)置和移除密碼

    在數(shù)字化時(shí)代,文檔的安全性變得越來越重要,特別是對于包含敏感信息的PDF文件,所以本文主要來和大家介紹一下如何使用Python實(shí)現(xiàn)為PDF文檔設(shè)置和移除密碼,需要的可以參考下
    2024-03-03
  • Pytorch加載數(shù)據(jù)集的方式總結(jié)及補(bǔ)充

    Pytorch加載數(shù)據(jù)集的方式總結(jié)及補(bǔ)充

    Pytorch自定義數(shù)據(jù)集方法,應(yīng)該是用pytorch做算法的最基本的東西,下面這篇文章主要給大家介紹了關(guān)于Pytorch加載數(shù)據(jù)集的方式總結(jié)及補(bǔ)充,文中通過實(shí)例代碼介紹的非常詳細(xì),需要的朋友可以參考下
    2022-11-11
  • Python實(shí)現(xiàn)去除圖片中指定顏色的像素功能示例

    Python實(shí)現(xiàn)去除圖片中指定顏色的像素功能示例

    這篇文章主要介紹了Python實(shí)現(xiàn)去除圖片中指定顏色的像素功能,結(jié)合具體實(shí)例形式分析了Python基于pil與cv2模塊的圖形載入、運(yùn)算、轉(zhuǎn)換等相關(guān)操作技巧,需要的朋友可以參考下
    2019-04-04
  • PIL.Image.open和cv2.imread的比較與相互轉(zhuǎn)換的方法

    PIL.Image.open和cv2.imread的比較與相互轉(zhuǎn)換的方法

    這篇文章主要介紹了PIL.Image.open和cv2.imread的比較與相互轉(zhuǎn)換的方法,文中通過示例代碼介紹的非常詳細(xì),對大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧
    2020-06-06
  • 解密Python中的作用域與名字空間

    解密Python中的作用域與名字空間

    名字空間對于 Python 來說是一個(gè)非常重要的概念,并且與名字空間這個(gè)概念緊密聯(lián)系在一起的還有名字、作用域這些概念,下面就來剖析這些概念是如何體現(xiàn)的
    2023-02-02
  • Python?pygame繪制游戲圖像

    Python?pygame繪制游戲圖像

    這篇文章主要介紹了Python?pygame繪制游戲圖像,文章圍繞主題展開pygame模塊完成飛機(jī)大戰(zhàn)游戲的實(shí)戰(zhàn)開發(fā)的案例詳情,需要的朋友可以參考一下
    2022-08-08
  • Python中卷積神經(jīng)網(wǎng)絡(luò)(CNN)入門教程分分享

    Python中卷積神經(jīng)網(wǎng)絡(luò)(CNN)入門教程分分享

    卷積神經(jīng)網(wǎng)絡(luò)(Convolutional Neural Networks, CNN)是一類特別適用于處理圖像數(shù)據(jù)的深度學(xué)習(xí)模型,本文介紹了如何使用Keras創(chuàng)建一個(gè)簡單的CNN模型,并用它對手寫數(shù)字進(jìn)行分類,需要的可以參考一下
    2023-05-05
  • Pytorch:dtype不一致問題(expected dtype Double but got dtype Float)

    Pytorch:dtype不一致問題(expected dtype Double but&

    這篇文章主要介紹了Pytorch:dtype不一致問題(expected dtype Double but got dtype Float),具有很好的參考價(jià)值,希望對大家有所幫助。如有錯(cuò)誤或未考慮完全的地方,望不吝賜教
    2023-02-02
  • Python使用melt和pivot實(shí)現(xiàn)DataFrame格式轉(zhuǎn)換

    Python使用melt和pivot實(shí)現(xiàn)DataFrame格式轉(zhuǎn)換

    在數(shù)據(jù)處理與分析中,經(jīng)常遇到數(shù)據(jù)需要進(jìn)行格式轉(zhuǎn)換的情況,例如將數(shù)據(jù)從寬表格式轉(zhuǎn)換為長表格式,或?qū)?shù)據(jù)重新分組匯總,Pandas提供了豐富的reshape操作,尤其是melt和pivot這兩個(gè)函數(shù),使得DataFrame可以在寬表與長表之間高效轉(zhuǎn)換,本文介紹的非常詳細(xì),需要的朋友可以參考下
    2025-01-01
  • Python趣味編程實(shí)現(xiàn)手繪風(fēng)視頻示例

    Python趣味編程實(shí)現(xiàn)手繪風(fēng)視頻示例

    本文與計(jì)算機(jī)視覺相關(guān),使用Python將圖片由自然風(fēng)轉(zhuǎn)化為手繪風(fēng),期間未對圖片進(jìn)行任何預(yù)處理、后處理;代碼中只借助了兩個(gè)常見庫,核心計(jì)算由Numpy負(fù)責(zé) ,Pillow 負(fù)責(zé)圖片讀寫
    2021-10-10

最新評論

佛坪县| 南靖县| 富裕县| 舒城县| 康保县| 工布江达县| 樟树市| 资中县| 滨州市| 曲沃县| 息烽县| 中超| 鄢陵县| 陵川县| 衡阳市| 缙云县| 务川| 蓝山县| 安宁市| 巴楚县| 平泉县| 肇东市| 泗水县| 玉溪市| 斗六市| 兴城市| 肥东县| 北宁市| 保亭| 泗洪县| 壤塘县| 双牌县| 彭泽县| 定襄县| 麻栗坡县| 河曲县| 屯门区| 广宗县| 青神县| 和龙市| 磐石市|