title: R pheatmap scale different than scale before pheatmap
body: <p>The heatmap when scaling before plotting:</p>
  
  <pre><code>mat_scaled &lt;- scale(t(mat))
  pheatmap(t(mat_scaled), show_rownames=F, show_colnames=F,
           border_color=F, color=colorRampPalette(brewer.pal(6,name="PuOr"))(12))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/BQQ6B.png" alt="heatmap scaling before plotting"></p>
  
  <p>with the scale going from [-2, 6] is completely different than when using the scaling within the <code>pheatmap</code> function </p>
  
  <pre><code>pheatmap(t(mat_scaled), scale="row", show_rownames=F, 
           show_colnames=F, border_color=F, color=colorRampPalette(brewer.pal(6,name="PuOr"))(12))
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/odQH8.png" alt="heatmap scaled within pheatmap function"></p>
  
  <p>where the scale is set from [-6,6].<br>
  Why is this difference and how could I obtain the matrix represented in the second figure?</p>