Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私はigraphが初めてです。この単純なコードを試しましたが、ノード内に頂点 ID が表示されません。
from igraph import * g = Graph() g.add_vertices(3) g.add_edges([(0,1), (1,2)]) plot(g, layout = g.layout("kk"))
IDが表示されない理由を誰か教えてください。
ID はデフォルトではラベルとして表示されないため ;) それらを表示したい場合はlabel、各ノードの属性をそのラベルに設定するかvertex_label=...、キーワード引数として次のように指定する必要がありますplot。
label
vertex_label=...
plot
g.vs["label"] = range(g.vcount())
また
plot(g, layout="kk", vertex_label=range(g.vcount())