Adrian Tompkins Adrian Tompkins - 10 months ago 33
R Question

Can't set colors of edges in igraph network

When I try to set the color of edges using the edge.color attribute, it doesn't work (I get default grey). However when I put the same attribute in the plot command, it works! What I am doing wrong? (I am using R version 3.4.1 (2017-06-30) -- "Single Candle" on a linux box). Other attributes such as arrow.size and width work fine for me, it is just the color that doesn't!

According to this Rpub tutorial for igraph, I should be able to do it both ways...

data<-matrix(rexp(25, rate=.1), ncol=5)

# this gives gray default edges, WHY?

# this give blues edges:

Answer Source

Use color, not edge.color (since it is an edge attribute this is already non-ambiguous).


enter image description here

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download