开发者

How can I alter the appearance of nodes in igraph?

开发者 https://www.devze.com 2022-12-21 15:22 出处:网络
I would like to lay out graphs (trees) with two types of node开发者_如何学Cs: boxes and circles.

I would like to lay out graphs (trees) with two types of node开发者_如何学Cs: 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)
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号