title: How to modify the RowSideColor column size in R's heatmap.2()
body: <p>I have the following data:</p>
  
  <pre><code>    foo_06.ix   bar_06.ix   bar_06.iz   qux_06.ix   qux_06.iz
  1416474_at Igdcc4   0.563   5.649   1.654   0.776   0.973
  1416576_at Socs3    5.793   5.417   0.694   3.256   0.951
  ...
  </code></pre>
  
  <p>Which I want to plot the hierarchical clustering heat map.</p>
  
  <p>With this code:</p>
  
  <pre><code>library(gplots);
  library(RColorBrewer);
  
  tm &lt;- read.table("http://dpaste.com/1494806/plain/",header=TRUE,sep="\t")
  
  nofclust &lt;- 21;
  # Clustering functions 
  hclustfunc &lt;- function(x) hclust(x, method="complete")
  distfunc &lt;- function(x) dist(x,method="euclidean")
  
  d.tm &lt;- distfunc(tm)
  fit.tm &lt;- hclustfunc(d.tm)
  clusters &lt;- cutree(fit.tm, k=nofclust)
  
  # Define colours
  hmcols &lt;- rev(brewer.pal(11,"Spectral"));
  selcol &lt;- colorRampPalette(brewer.pal(12,"Set3"))
  selcol2 &lt;- colorRampPalette(brewer.pal(9,"Set1"))
  sdcol= selcol(5);
  clustcol = selcol2(nofclust);
  
  # Plot heatmap
  pdf(file="tmp.pdf",width=27,height=27);
  heatmap.2(as.matrix(tm),dendrogram="row",scale="row",RowSideColors=clustcol[clusters],ColSideColors=sdcol,col=hmcols,trace="none", margin=c(12,12), hclust=hclustfunc,distfun=distfunc,lwid=c(0.1,0.1,0.1,0.1,0.1),keysize=0.5);
  dev.off()
  </code></pre>
  
  <p>It produces the following figure:
  <img src="https://i.stack.imgur.com/tzJnT.jpg" alt="enter image description here"></p>
  
  <p>Using the fixed PDF size (27x27) what I want to do:</p>
  
  <ol>
  <li><p>Create the heatmap where the <code>row side column</code> is smaller than all
  5 primary columns. Currently it's too wide.
  These 5 primary column size I fixed with <code>lwid=0.1</code>, so do not change.</p></li>
  <li><p>Squeeze the dendogram.</p></li>
  <li>If the above two takes effect, the  row names on the right takes prominent space in the page.</li>
  </ol>
  
  <p>How can I modify my code above to achieve these?</p>