简体   繁体   English

图:解决紧密重叠的节点

[英]igraph: Resolving tight overlapping nodes

I have a graph with few hundred nodes and edges. 我有一个带有数百个节点和边的图。 The disconnected subgraphs separate out and resolve well but the nodes within subgraphs overlap and do not resolve well. 断开连接的子图分开并很好地解析,但是子图中的节点重叠并且不能很好地解析。 I have tried several layout algorithms and have also tried changing the relevant parameters within the layout algorithm (ex: iter, kkconst, start.temp etc). 我尝试了几种布局算法,还尝试更改布局算法中的相关参数(例如:iter,kkconst,start.temp等)。 But, I am still not able to disperse the tightly clustered nodes. 但是,我仍然无法分散紧密聚集的节点。 See figure below. 参见下图。

I was hoping to find some parameter to control attraction/repulsion/gravity etc but there seems to be none. 我希望找到一些参数来控制吸引力/排斥力/重力等,但似乎没有。 The answer and figures from bdemarest in this question does seem to fix exactly this issue. 答案从数字bdemarest在这个问题似乎解决正是这个问题。 Strangely enough, several seemingly useful parameters have been deprecated in the new version of igraph (coolexp, maxdelta, area, repulserad etc). 奇怪的是,在新版本的igraph中已弃用了几个看似有用的参数(coolexp,maxdelta,area,repulserad等)。

Does anyone know of a way to keep the sub graphs well separated while spreading out close nodes well enough that they do not overlap? 有谁知道一种使子图保持良好分离的方法,同时又可以很好地散布紧密的节点,使其不重叠?

图表

I managed to get it to work using package qgraph . 我设法使用软件包qgraph使它工作。

在此处输入图片说明

Here is a working example: 这是一个工作示例:

library(igraph)
library(qgraph)

g <- barabasi.game(355, directed=FALSE)

png("plot1.png", height=6, width=12, units="in", res=250)
par(mfrow=c(1, 3))

plot(g,layout=layout_with_fr,vertex.size=4,vertex.label=NA)
mtext("layout_with_fr", side=1)

e <- get.edgelist(g)
l <- qgraph.layout.fruchtermanreingold(e,vcount=vcount(g))
plot(g,layout=l,vertex.size=4,vertex.label=NA)
mtext("qgraph.layout.fruchtermanreingold default", side=1)

l <- qgraph.layout.fruchtermanreingold(e,vcount=vcount(g),
      area=8*(vcount(g)^2),repulse.rad=(vcount(g)^3.1))
plot(g,layout=l,vertex.size=4,vertex.label=NA)
mtext("qgraph.layout.fruchtermanreingold modified", side=1)

dev.off()

图2

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM