Here is an example using netdiffuseR::drawColorKey (either from CRAN or
http://github.com/USCCANA/netdiffuseR), the color key is on the right, but if you want you can take that function and tweak it a little bit so you can have it on the bottom.
set.seed(1231)
library(igraph)
library(netdiffuseR)
all <- barabasi.game(100, m=2)
indegree<-degree(all, v = V(all), mode = c("in"))
outdegree<-degree(all, v = V(all), mode = c("out"))
V(all)$size <- (indegree+2)/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)
# Color scale [0,1]
col <- (indegree - min(indegree))/(max(indegree) - min(indegree))
# Color using blues9
V(all)$color<- rgb(colorRamp(blues9)(col), maxColorValue = 255) # 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)
netdiffuseR::drawColorKey(
indegree, nlevels=5,
color.palette=colorRampPalette(blues9)(5),
main="Indegree")
# dev.off()