jokergoo / ComplexHeatmap

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

add `heatmap_legend_list` and `annotation_legend_list` slots #1139

Closed Yunuuuu closed 1 week ago

Yunuuuu commented 7 months ago

try to deal with https://github.com/jokergoo/ComplexHeatmap/issues/1138

library(ggplot2)
library(ComplexHeatmap)
x <- sample(1:10, 10L)
m <- rbind(1:10, 11:20)
rownames(m) <- paste0("row ", seq_len(nrow(m)))
colnames(m) <- paste0("col ", seq_len(ncol(m)))
draw(eheat::ggheat(m, function(p) {
    p + scale_fill_viridis_c() +
        ggplot2::geom_text(
            aes(label = sprintf("%s * %s", .row_index, .column_index))
        )
}, column_km = 2L), merge_legends = TRUE)

image