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 包的文档中有一个例子
igraph.options(plot.layout=layout.reingold.tilford) plot(graph.tree(20, 2))
输出应将数据表示为树。但我得到的是
您显然需要指定根:
library(igraph) g <- graph.tree(20, 2) plot(g, layout = layout.reingold.tilford(g, root=1))