title: igraph network graph with color-gradient bar
body: <p>I am trying to to add color-gradient bar below the network graph I draw using igraph. For some reason, the axis label of the color-gradient bar can't be shown. However , when I draw the color-gradient bar alone without the network graph, the axis label is perfectly shown. Any suggestion ? </p>
  
  <pre><code>colorstrip &lt;- function(colors) {
    count &lt;- length(colors)
    m &lt;- matrix(1:count, count, 1)
    par(mai=c(5, 50, 30, 50), cex.axis=2, ann=T, tck=-1)
    image(m, col=colors, ylab="", axes=FALSE)
    axis(side=3, at=seq(from=-0.165, to=1.22, by=0.332),
         labels=letters[1:5])
  }
  
  library(igraph)
  g &lt;- graph.ring(10)
  
  pdf("test_igraph.pdf", width=200, height=200)
  layout(matrix(c(1,2), nrow=2), heights=c(2,0.5))
  plot(g)
  colorstrip(c("red", "mediumseagreen", "yellow", "blue"))
  dev.off()
  </code></pre>
  
  <p><a href="https://gist.github.com/6911981" rel="nofollow">Original code was here</a></p>