R中的iGraph包:边缘标签重叠



我正在使用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)

如您所见,我的边缘标签(箭头的标签)是重叠的。如何解决这个问题?

提前感谢!

这是执行此操作的代码。它使用边缘列表而不是 igraph,但它是一个看起来更酷的图形。

    library(qgraph)
    qgraph(mydata,edge.labels=T)

查看此帖子以获取更多详细信息

在 R 中绘制网络(控制边粗细加上非重叠边)

这个使用 qgraph 的帮助页面:http://rgm3.lab.nig.ac.jp/RGM/R_rdfile?f=qgraph/man/qgraph.Rd&d=R_CC

最新更新