R中的igraph包:边标签重叠问题

9

我正在使用R中的igraph软件包来可视化网络流。

library(igraph)

# Example Data:
b <- c("countryA", "countryB", "countryC", "countryA", "countryC", "countryA")
c <- c("countryB", "countryC", "countryA", "countryB", "countryA", "countryB")
d<- c(100, 200, 200, 300, 400, 200)
e <- c(5,12,10,24,25,12)
mydata <- data.frame(b,c,d,e)
colnames(mydata) <- c("exporteur", "partner", "tradeflow", "price")

# Plot in igraph
mydata.igraph <- graph.data.frame(mydata)
E(mydata.igraph)$label <- mydata[,3]
plot(mydata.igraph)

如您所见,我的边缘标签(箭头标记)重叠了。如何解决呢?

提前感谢!


vertex.label.dist是可能的,但对于边缘似乎还没有(https://bugs.launchpad.net/igraph/+bug/530802)。 - user1317221_G
2
你现在不能轻易地自定义R igraph中边缘标签的位置。看看sna包,可能支持它,尽管我没有检查,所以不确定。如果你想绘制图表,你也可以看看diagram包。要使用igraph进行绘图,你需要使用text()函数将标签作为额外步骤进行绘制。 - Gabor Csardi
1个回答

1

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接