title: Colours across Plots / Heatmaps in R
body: <p>I am creating a number of heatmaps in R, but I am having problems when it comes to keeping the colour scale consistent across graphs. </p>
  
  <p>I find that the colours are scaled within a graph, is there a way to make colours consistent across graphs? Ie. So that that colour difference between a value of 0.4 and 0.5 is always the same?</p>
  
  <p><em>Code Example:</em></p>
  
  <pre><code>set.seed(123)
  
  d1 = matrix(rnorm(9, mean = 0.2, sd = 0.1), ncol = 3)
  d2 = matrix(rnorm(9, mean = 0.8, sd = 0.1), ncol = 3)
  
  mat = list(d1, d2)
  
  for(m in mat)
    heatmap(m, Rowv = NA ,Colv = NA)
  </code></pre>
  
  <p>You'll note in the example that cell (2,3) the first graph is similar to cell (1,3) in the second, despite being ~0.8 different</p>