日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

pyecharts怎么绘制散点图_pyecharts可视化和wx的结合

發布時間:2025/3/12 编程问答 41 豆豆
生活随笔 收集整理的這篇文章主要介紹了 pyecharts怎么绘制散点图_pyecharts可视化和wx的结合 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

前言

最近在研究 pyecharts 的用法,它是 python 的一個可視化工具,然后就想著結合微信來一起玩

不多說,直接看效果:

條形圖.gif

環境配置

pip install pyecharts

pip install snapshot_selenium

pip install echarts-countries-pypkg

pip install echarts-china-provinces-pypkg

pip install echarts-china-cities-pypkg

pip install echarts-china-counties-pypkg

pip install wxpy

獲取好友

主要是獲取好友基本數據,用來做數據可視化

代碼如下:

from wxpy import Bot, Chat

class Demo(Chat):

@staticmethod

def get_friend():

bot = Bot()

friends = bot.friends(update=True)

friend_data = []

for friend in friends:

if friend.sex == 1:

sex = "男"

elif friend.sex == 2:

sex = "女"

else:

sex = ""

friend_dict = {

"city": friend.city,

"province": friend.province,

"sex": sex,

"signature": friend.signature,

}

friend_data.append(friend_dict)

return friend_data

地理坐標圖

地理坐標系組件用于地圖的繪制,支持在地理坐標系上繪制散點圖,線集。

在 pyecharts 中地理坐標圖主要是基于 Geo 模塊

def geo_base():

city_data = get_data()

geo = Geo(init_opts=opts.InitOpts(theme="vintage"))

for city in city_data:

try:

geo.add_schema(maptype="china

創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎

總結

以上是生活随笔為你收集整理的pyecharts怎么绘制散点图_pyecharts可视化和wx的结合的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。