2

我想用两种类型的节点布置图(树):框和圆。

igraph 可以做到这一点吗?一个最小的例子会是什么样子?

4

1 回答 1

5
library(igraph)
g <- graph.empty()
g <- add.vertices(g, 4, 
    label=c('a', 'b', 'c', 'd'), 
    shape=c('rectangle', 'rectangle', 'circle', 'circle'))
g <- add.edges(g, c(1, 2, 2, 3))
plot(g)
于 2010-02-27T04:07:22.963 回答