문제

I am trying to create a network graph with overlapping edges.

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"))

Result

This results in 8 non-overlapping edges between 'a' and 'b'. What can I do to replace these non-overlapping lines with a thicker line (proportional to 8 times a single line)?

도움이 되었습니까?

해결책

Set curved to FALSE, and width to the number of multiple edges using count.multiple, see the details in the manual: 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"))

graph plot

다른 팁

Used edge.curved=FALSE and got the result.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top