title: Changing the order by which heatmap cluster branches are plotted
body: <p>I have 3 heatmaps: each one for a different bacterial species (each one with 3 replicates) growing at different pH: 5.0, 7.4 and 9.8.</p>
  
  <p><strong>To plot the heatmap</strong>:</p>
  
  <pre><code>library(gplots)
  
  heatmap.2(data.scale, key = TRUE, keysize = 1, Rowv = NULL,
    Colv = as.dendrogram(hclust(col.clus, method = "average")),
    density.info = "none", trace = "none", cexCol = "0.95",
    cexRow = "0.59", margins = c(4, 10), col = heat.colors,
    dendrogram = ('column'))
  </code></pre>
  
  <p>In my heatmap (see figure) pH 9.8 appears first separated from pH 5 and pH 7.4. I know it is logical because it is organized by similarity given by euclidean distance. But for visual purposes I want the order of appearence to be pH 5.0, pH 7.4 and pH 9.8, because each heatmap will have the different pH appearing in different orders.</p>
  
  <p>Is there a way to do this with R? Or it is logically impossible?</p>
  
  <p><a href="https://i.stack.imgur.com/GasqU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GasqU.png" alt=":"></a></p>