问题
In the docs of igraph package there is an example
igraph.options(plot.layout=layout.reingold.tilford)
plot(graph.tree(20, 2))
the output should represent data as a tree. But what I get is
回答1:
You apparently need to specify the root:
library(igraph)
g <- graph.tree(20, 2)
plot(g, layout = layout.reingold.tilford(g, root=1))
来源:https://stackoverflow.com/questions/18270370/plot-tree-with-graph-tree-function-from-igraph