title: How to show annotation in ComplexHeatmap in R
body: <p>I have 31 samples,and get 31 type of samples, such &quot;a&quot;,&quot;b&quot;,&quot;c&quot;,&quot;d&quot;,but when i draw heatmap,it say the subscript out.I have check the columns of the matrix is 31 ,which is the same as the number of types.</p>
  <pre><code>ha1 = HeatmapAnnotation( bar = c(&quot;b&quot;,&quot;d&quot;,&quot;d&quot;,&quot;b&quot;,&quot;b&quot;,&quot;c&quot;,&quot;b&quot;,&quot;a&quot;,&quot;b&quot;
                       ,&quot;b&quot;,&quot;a&quot;,&quot;d&quot;,&quot;b&quot;,&quot;b&quot;,&quot;c&quot;,&quot;c&quot;,&quot;a&quot;,&quot;b&quot;
                       ,&quot;d&quot;,&quot;c&quot;,&quot;c&quot;,&quot;d&quot;,&quot;b&quot;,&quot;b&quot;,&quot;b&quot;,&quot;d&quot;,&quot;a&quot;
                       ,&quot;c&quot;,&quot;c&quot;,&quot;b&quot;,&quot;c&quot;),
  col = list(bar = c(&quot;a&quot; = &quot;red&quot;, &quot;b&quot; = &quot;green&quot;, &quot;c&quot; = &quot;blue&quot;,&quot;d&quot;=&quot;black&quot;))
   )
  ha = rowAnnotation(foo = anno_mark(at = seq(0,7000,1000), labels = seq(0,7000,1000)))
  hist_major &lt;- Heatmap(major,
                    column_title = &quot;Statistics for a list of SNP.Frequency.major&quot;,
                    column_title_gp = gpar(fontsize = 15, fontface = &quot;bold&quot;),
                    column_names_gp = gpar(fontsize = 10),
                    row_title = &quot;Genome Postion(bp)&quot;,
                    row_title_gp = gpar(fontsize = 10),
                    name = &quot;Variant.Frequency&quot;, 
                    cluster_rows = FALSE,
                    column_order=order(as.numeric(gsub(&quot;SAMN041259&quot;, &quot;&quot;, colnames(major)))),
                    show_column_dend = FALSE,
                    right_annotation = ha,
                    bottom_annotation = ha1,
                    show_row_names = FALSE,
                    use_raster= TRUE,
                    raster_resize_mat = max,
                    col = cols,
                    border_gp = gpar(col = &quot;black&quot;, lty = 2)
  )
  </code></pre>