Question

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

Was it helpful?

Solution

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

OTHER TIPS

Used edge.curved=FALSE and got the result.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top