ComplexHeatmap: Increase label size of side annotation?

Viewed 2769

Hi is there a way to increase the font size of the label for each of the annotation? I tried using gpar setting the fontsize but does'nt seem to be effecting it. For example using the example in the vignette.

    ha = HeatmapAnnotation(foo = anno_barplot(matrix(nc = 2, c(1:10, 10:1))) 
, gp = gpar(fontsize=20)  )

What I essentially want is to have foo labeled with font size 20

enter image description here

1 Answers

The parameter to control that is annotation_name_gp= gpar(fontsize = 20). Reproducible example:

library(ComplexHeatmap)
set.seed(123)
mat = matrix(rnorm(100), 10)
rownames(mat) = paste0("R", 1:10)
colnames(mat) = paste0("C", 1:10)
column_ha = HeatmapAnnotation(foo1 = runif(10), bar1 = anno_barplot(runif(10)),
                              annotation_name_gp= gpar(fontsize = 20))
row_ha = rowAnnotation(foo2 = runif(10), bar2 = anno_barplot(runif(10)))
Heatmap(mat, name = "mat", top_annotation = column_ha, right_annotation = row_ha)

Related