pyecharts第五节、关系图
生活随笔
收集整理的這篇文章主要介紹了
pyecharts第五节、关系图
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
需要安裝pyecharts
pip install pyecharts -U創(chuàng)建【demo5.py】測(cè)試類
?
輸入以下編碼:
from pyecharts import options from pyecharts.charts import Graphnodes = [{"name": "星光點(diǎn)1", "symbolSize": 30},{"name": "暗影星2", "symbolSize": 30},{"name": "光芒星3", "symbolSize": 30},{"name": "閃耀星4", "symbolSize": 30},{"name": "縱橫星5", "symbolSize": 30},{"name": "智慧星6", "symbolSize": 30} ] links = [] for i in nodes:for j in nodes:links.append({"source": i.get("name"), "target": j.get("name")})g = (Graph().add("", nodes, links, repulsion=8000).set_global_opts(title_opts=options.TitleOpts(title="六星光芒陣演示")).render("guangmang.html") )執(zhí)行:
打開(kāi)生成文件:
?
效果圖如下:
希望能對(duì)大家有所幫助。
總結(jié)
以上是生活随笔為你收集整理的pyecharts第五节、关系图的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: pyecharts第四节、漏斗图
- 下一篇: ImportError: cannot