title: How to add ColSideColors on heatmap.2 after performing bi-clustering (row and column)
body: <p>I have the following code:</p>
  
  <pre><code>library(gplots)
  library(RColorBrewer);
  
  setwd("~/Desktop")
  mydata &lt;- mtcars
  hclustfunc &lt;- function(x) hclust(x, method="complete")
  distfunc &lt;- function(x) dist(x,method="euclidean")
  
  d &lt;- distfunc(mydata)
  fit &lt;- hclustfunc(d)
  clusters &lt;- cutree(fit, h=100)
  nofclust.height &lt;-  length(unique(as.vector(clusters)));
  
  # Colorings
  hmcols &lt;- rev(redgreen(2750))
  selcol &lt;- colorRampPalette(brewer.pal(12,"Set3"))
  selcol2 &lt;- colorRampPalette(brewer.pal(9,"Set1"))
  clustcol.height = selcol2(nofclust.height);
  
  heatmap.2(as.matrix(mydata), 
             trace='none', 
             dendrogram='both', 
             key=F,
             Colv=T, 
             scale='row',
             hclust=hclustfunc, distfun=distfunc, col=hmcols,
             symbreak=T,
             margins=c(7,10), keysize=0.1,
             lwid=c(5,0.5,3), lhei=c(0.05,0.5),
             lmat=rbind(c(5,0,4),c(3,1,2)),
             labRow=rownames(mydata),
             #ColSideColors=clustcol.height[clusters],  # This line doesn't work
             RowSideColors=clustcol.height[clusters])
  </code></pre>
  
  <p>Which produce the following figure:
  <img src="https://i.stack.imgur.com/b1lii.jpg" alt="enter image description here"></p>
  
  <p>What I want to do is to perform clustering on both row and column and show clustering bars (RowSideColors and ColSideColors) next to dendogram. How can I achieve that?</p>
  
  <p>At the moment I only succeed in showing <code>RowSideColors</code> <strong>but not</strong> the <code>ColSideColors</code> one. </p>