문제

I would like to lay out graphs (trees) with two types of nodes: boxes and circles.

Is this possible with igraph and how would a minimal example look like?

도움이 되었습니까?

해결책

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)
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top