1

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

2 Answers 2

2

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

1
  • Thanks! The width part was helpful.
    – Divi
    Apr 22, 2014 at 1:11
0

Used edge.curved=FALSE and got the result.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.