【问题标题】:How to get overlapping edges using igraph?如何使用 igraph 获得重叠边缘?
【发布时间】:2014-04-22 01:58:41
【问题描述】:

我正在尝试创建一个边缘重叠的网络图。

require(igraph)
g <- graph( c(1,2, 1,2, 1,2, 1,2, 1,2, 1,2, 1,2, 1,2, 1,3, 2,3, 3,5), n=5, directed=FALSE )
V(g) #Vertex sequence
E(g) #Edge sequence
plot(g, layout=layout.circle, vertex.label=c("a","b","c","d","e"))

这会在“a”和“b”之间产生 8 个不重叠的边缘。如何用较粗的线(与单线的 8 倍成比例)替换这些不重叠的线?

【问题讨论】:

    标签: r igraph


    【解决方案1】:

    curved设置为FALSE,将width设置为使用count.multiple的多重边数,详见手册:http://igraph.org/r/doc/plot.common.html

    E(g)$curved <- FALSE
    E(g)$width <- count.multiple(g)
    plot(g, layout=layout.circle, vertex.label=c("a","b","c","d","e"))
    

    【讨论】:

    • 谢谢!宽度部分很有帮助。
    【解决方案2】:

    使用edge.curved=FALSE,得到了结果。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2023-04-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-07-23
      • 2021-11-09
      • 1970-01-01
      相关资源
      最近更新 更多