如何加长igraph网络图中的边缘(layout = fruchterman.reingold)?
尝试在R中绘制网络图. 如何使用IGraph延长网络图中的边?
Trying to do a network plot in R. How do I lengthen edges in a network graph using IGraph?
我实际上想使用fruchterman-reingold布局.有什么方法可以使基于力的算法更弹性",使我的顶点更远?
I actually want to use the fruchterman-reingold layout. Is there some way I can make that force-based algorithm "springier" so that my vertices are further apart?
谢谢.
您可以使用layout.fruchterman.reingold
函数控制Fruchterman-Reingold算法.请参阅:help('layout.fruchterman.reingold')
.我经常使用的设置会为您提供更多的间距:
You can control the Fruchterman-Reingold algorithm using the layout.fruchterman.reingold
function. see: help('layout.fruchterman.reingold')
. A setup that I often use and gets you a little more spacing is:
l <- layout.fruchterman.reingold(g,niter=500,area=vcount(g)^2.3,repulserad=vcount(g)^2.8)
plot(g,layout=l)
其中g
是您的图形对象.最好只为图形测试这些参数的不同值,然后看看有什么用.特别地,repulserad
影响图形中的间距.默认值是节点数的平方,因此值越高,您获得的图形空间就越多.
where g
is your graph object. Best to just test different values of these parameters for your graph and see what works. Especially repulserad
influences the spacing in a graph. The default is the square of the number of nodes, so higher values should get you more spaced graphs.