如何通过holoviz和NetworkX渲染GraphViz点文件?

2024-10-03 19:26:13 发布

您现在位置:Python中文网/ 问答频道 /正文

所以我观察了一下docs,发现他们使用Graphviz,但不使用任何文件。。。我有一个4mil+ .dot (70mb) graph file我想渲染。如何通过holoviz和NetworkX打开和渲染GraphViz点文件

##更新: Tested@GijsWobben sample:在偶数small 6kb file上显示nada enter image description here

小文件也需要类似的内容: enter image description here


Tags: 文件samplenetworkxdocsdotgraphvizfilegraph
1条回答
网友
1楼 · 发布于 2024-10-03 19:26:13

这个怎么样:

import hvplot.networkx as hvnx

import networkx as nx
import holoviews as hv

# Read the file
G = nx.drawing.nx_agraph.read_dot("./figure.dot")

# Rest of the tutorial...
spring = hvnx.draw(G, with_labels=True)

# Show the plot
spring

相关问题 更多 >