title: Error in check.length("fill") : 'gpar' element 'fill' must not be length 0
body: <p>I faced a very weird error, possibly a bug in <code>R 3.5.1</code> or <code>pheatmap</code></p>
  
  <p>The following code is working fine:</p>
  
  <pre><code>rownames(df) &lt;- colnames(mat)
  xx &lt;- pheatmap(mat, annotation_col=df)
  </code></pre>
  
  <p>But the following is not working:</p>
  
  <pre><code>rownames(df) &lt;- str_sub(colnames(mat), 1, -3)
  xx &lt;- pheatmap(mat, annotation_col=df)
  </code></pre>
  
  <p>Everything just looks perfect, but it is giving the error:</p>
  
  <blockquote>
    <p>Error in check.length("fill") : 
      'gpar' element 'fill' must not be length 0</p>
  </blockquote>
  
  <p>I reloaded <code>Rstudio</code> but the problem persists. Any modifications of <code>rownames</code> of <code>df</code> makes it impossible to draw the chart. I tried also <code>substr</code> function.
  Does anybody know why this is happening?</p>