igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[igraph] plot graph with color of nodes as node out-degree + colorbar


From: Giulia Rossello
Subject: [igraph] plot graph with color of nodes as node out-degree + colorbar
Date: Sun, 30 Oct 2016 14:46:18 +0100

Dear all,
I am trying to plot a graph using a color scale corresponding to node's out-degree.
Moreover, I would like to create a colorbar at the bottom of the plot for with the corresponding color scale of node's out-degree.
Here what I am doing:

#ALL
indegree<-degree(all, v = V(all), mode = c("in"))
outdegree<-degree(all, v = V(all), mode = c("out"))

V(all)$size <- indegree+2
V(all)$frame.color <- "white"
l<-layout_with_fr(all)
E(all)$arrow.size <- .09
E(all)$edge.color <- "gray80"
E(all)$width <- 1+E(all)$weight/max(E(all)$weight)
V(all)$color<-rainbow(length(outdegree))[rank(outdegree)]

pdf(paste(dr[1],year[1],"-",year[length(year)],field[1],"allnet.pdf"))

plot(all, layout=l,vertex.label=NA)
dev.off()


Do you have some suggestions?
Thank you in advance

reply via email to

[Prev in Thread] Current Thread [Next in Thread]