Change attributes of one node

扶醉桌前 提交于 2019-12-06 11:23:39

V(g9)$color is an array of colors.

To change color of a specific node say 2: V(g9)$color[2] ="#343434FF"

If you want different color for each node, you can specify rainbow(n) where n is number of nodes and this function generates a array of colors and then you can specify: V(g9)$color=rainbow(9)

Also note: To get a list of vertices or nodes you can get them: V(g9) and then if you decide to change the color of vertex 5, you can use V(g9)$color[which(V(g9)==5)]="#434344" where, which(V(g9)==5) matches to vertex or node 5.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!