jokergoo / ComplexHeatmap

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

Multiple Annotations With Same Colour Scale Cause Many Legends #1202

Open DarioS opened 3 months ago

DarioS commented 3 months ago

Let's say we have five treatments for each sample, each with levels Resistant, Sensitive. It is presently not possible to define HeatmapAnnotation without a legend for each variable but a single master legend.

image .

asalt commented 1 month ago

A possible solution is you could define multiple HeatmapAnnotations and stack them on top of each other (or next to each other if rowAnnotation), and set show_legend = FALSE for all but one. You can control the legend title as well if you use the list syntax columnAnnotation(Class = anno_simple(metadata$Erlotinib))