Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我希望图中节点的大小取决于计算的顶点的中介中心性。如何才能做到这一点?
我当前的代码如下:
require(igraph) g <- read.graph("data.graphml", "graphml") plot(g,vertex.size = x,layout = layout.fruchterman.reingold)
如何将“x”设置为取决于节点的中间中心性的顶点大小?
使用igraph, 并按照 中的示例进行操作?betweenness:
igraph
?betweenness
g <- random.graph.game(10, 3/10) plot(g, vertex.size=betweenness(g))
(注意数字是节点号,不是中介值)
如果您有很多大值或以其他方式改善可视化,您可能需要重新调整顶点大小。
g = graph.lattice(c(10,4)) plot(g,vertex.size=betweenness(g)/10)
没有/10顶点太大。
/10