我正在使用 R 中的 igraph 创建一个由大约 600 个节点包围的单个“中心”节点的网络可视化。
节点重叠,然后我可以使用这个问题的答案(使用 qgraph)来解决这个问题。
然而,该解决方案似乎仅适用于大小相同的节点。在我的网络中,节点大小是可变的。有没有办法通过在确定节点之间的距离时考虑节点大小来避免重叠?
示例代码如下:
# create network
net <- graph_from_data_frame(d=links, vertices=nodes, directed=T)
# set colors
colrs <- c("#8DD3C7", "#FFFFB3")
V(net)$color <- colrs[V(net)$type]
# no labels
V(net)$label <- NA
# create a network graph with non-overlapping nodes:
# using /sf/ask/2750363661/
e <- get.edgelist(net,names = F)
l <- qgraph.layout.fruchtermanreingold(e,vcount=vcount(net))
plot(net,layout=l,vertex.size=4,edge.arrow.mode=0,vertex.label=NA)
Run Code Online (Sandbox Code Playgroud)
这是结果:

但现在当我更改节点大小时:
# setting node size based on data
V(net)$size <- V(net)$nodesize;
# plot result
plot(net,layout=l,edge.arrow.mode=0,vertex.label=NA)
Run Code Online (Sandbox Code Playgroud)
...节点重叠:

感谢您的帮助!
* …