Entering edit mode
7 months ago
hannes.bongartz
•
0
I am trying to work get the fontsize of a heatmap rowannotation customized. How can I achieve this endeavor?
Here is my code:
mark_at = which(rownames(mat_ht) %in% gene_names_interesting_in_clusters) # look up label names which should be displayed
ha = rowAnnotation(text = anno_mark(at = mark_at, labels = gene_names_interesting_in_clusters),annotation_name_gp = gpar(fontsize = 2)) # set rowAnnotations and change fontsize
if (save_plots=='yes') {
tiff(file="heatmap_genes_of_upreg_upon_aRinp100test.tiff",width = 6, height = 6, units = 'in',res = 600)
}
Heatmap(mat_ht, name = "Z-score", cluster_rows = TRUE, cluster_columns = FALSE, right_annotation = ha,
show_row_names = FALSE, show_column_names = FALSE,row_names_gp = gpar(fontsize = 4), km=16,row_title_gp = gpar(fontsize = 4))
if (save_plots=='yes') {
dev.off()
} # create heatmap
Many thanks in advance!
Try tweaking the
gp
of the rowAnnotation instead of tweaking theannotation_name_gp
- that might do the trick.Thank you. What exactly do you mean? Changing
ha = rowAnnotation(text = anno_mark(at = mark_at, labels = gene_names_interesting_in_clusters),annotation_name_gp = gpar(fontsize = 2))
toha = rowAnnotation(text = anno_mark(at = mark_at, labels = gene_names_interesting_in_clusters),gp = gpar(fontsize = 2))
?Yes. The solution to most things with ComplexHeatmap is to play around with parameters.
It doesn't work. The annotation labels are still in a default fontsize. I cant find a way to set the fontsize.
Please check out in this link.
Thanks for the input. Unfortunately, that didn't help either. I appreciate any other tips.
Thank you
I still cannot find a way. It seems to be an easy to solve issue and I was trying any possible combination with the aforementioned gp=gpar(fontsize=...) solutions. However, I wasnt able to resolve it. Can please someone help? Thank you
Please do not add answers unless you're actually answering the question. I've moved your post to a comment.