ComplexHeatmap
ComplexHeatmap copied to clipboard
changing font size of labels of column annotations
Hello, Thank you for the great package. I am trying to change the font size of the labels of the column annotations without success. Here is an example:
set.seed(123)
M<-matrix(rnorm(36),nrow=6)
dimnames(M) <- list(rownames(M, do.NULL = FALSE, prefix = "row"),colnames(M, do.NULL = FALSE, prefix = "col"))
columnAnnot <- data.frame(group=c(rep("group1",3),rep("group2",3)))
rownames(columnAnnot) <- colnames(M)
Ann.color.all <- list()
Ann.color.all[[1]] <- c("green","yellow")
names(Ann.color.all[[i]]) <- unique(columnAnnot[,1])
names(Ann.color.all)[i] <- colnames(columnAnnot)[I]
column_Annotation <- HeatmapAnnotation(df=columnAnnot,col=Ann.color.all)
h <- ComplexHeatmap::Heatmap(M,
column_split = columnAnnot,
cluster_columns = FALSE,
show_row_dend = FALSE,
show_row_names = TRUE,
heatmap_legend_param = list(title = "Expression"),
gap = unit(1,"mm"),
show_column_names = FALSE,
top_annotation = column_Annotation,
column_title_rot=angle_col, #can be 0 or 90
row_names_gp = grid::gpar(fontsize = rownames_font_size))
I am trying to change the font size of "group1" and "group2" above the green and yellow bars. Is this possible?
Thank you
And here is an image of the heatmap and the test that I am trying to change the font size:
try changing annotation_name_gp= gpar(fontsize = 20), I think that also looking at section 3.14 on https://jokergoo.github.io/ComplexHeatmap-reference/book/heatmap-annotations.html might be helpful!