jokergoo / ComplexHeatmap

Make Complex Heatmaps
https://jokergoo.github.io/ComplexHeatmap-reference/book/
Other
1.25k stars 220 forks source link

Question: How to format labels in anno_barplot #1155

Open FriederikeHanssen opened 5 months ago

FriederikeHanssen commented 5 months ago

hi,

thank you for this fantastic package. I have been playing around with the upset plot function to plot various GenomicRanges objects. I would like to stack my various upset plots, which works great. However, how could I add the amount of bases back to my annotations, as they are shown when plotting the upset plots separately?:

Plotted separately:

Screenshot 2024-01-22 at 15 29 32

when stacking my plots, the numbers are un-formatted:

Screenshot 2024-01-22 at 15 29 49

Is there a good way to write them similarly to the first plot?

Here is the code I have been using:

top_ha = HeatmapAnnotation(
    "Deletions" = anno_barplot(comb_size(m_del), 
        gp = gpar(fill = "black"), height = unit(2, "cm"), add_numbers = TRUE,
        axis_param = list(at = c(0, 2e8, 4e8),
            labels = c("0Mb", "200Mb", "400Mb"))), 
    "Amplification" = anno_barplot(comb_size(m_gain), 
        gp = gpar(fill = "black"), height = unit(2, "cm"),
        axis_param = list(at = c(0, 2e9, 4e9),
            labels = c("0Mb", "2000Mb", "4000Mb"))), 
    gap = unit(2, "mm"), 
    annotation_name_side = "left", 
    annotation_name_rot = 0)
# the same for using m2 or m3
UpSet(m_del, top_annotation   = top_ha)

package version: 2.14.0

Thanks in advance for any help :)