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