如何加长igraph网络图中的边缘(layout = fruchterman.reingold)? [英] How do I lengthen edges in an igraph network plot (layout=fruchterman.reingold)?

查看:608
本文介绍了如何加长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.

这篇关于如何加长igraph网络图中的边缘(layout = fruchterman.reingold)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆