ComplexHeatmap icon indicating copy to clipboard operation
ComplexHeatmap copied to clipboard

[enhancement] texture and flexible annotation legend placing

Open wbvguo opened this issue 2 years ago • 1 comments

Dear ComplexHeatmap developer,

First of all, thank you for developing/maintaining this wonderful tool!

During my using this package, I found that discrete annotation legends are very useful to denote which columns/rows/blocks belong to what categories. While we can use distinct colors to distinguish different categories, when the number of categories increases, it becomes harder to find an appropriate color set that suits everyone (e.g. people with color weaknesses). May I ask if there is any plan to include the texture as an alternative to the colors? (Say we have 2 variables with discrete values, when plotting the annotation, we can use the color for one variable and use texture for another variable)

Another issue is about the legend placing, I try to place all the annotation legends on the top of the heatmap, so I set annotation_legend_side = "top", and the plot is generated as expected with both legends placed around "topcenter". But I did not find a way to adjust the spacing between 2 different legends, may I ask if there is a way to increase the distance between 2 legends?

On the other hand, we do not always want to plot annotation legends on the same side, will there be any plan to allow users to assign the location of each annotation legend? For example, sth like this:

draw(myHeatmap, annotation_legend_side = c(legend1 = "top", legend2 = "left", legend3="right"))

Thanks!

wbvguo avatar Jun 15 '22 10:06 wbvguo

Currently you can separate placing of heatmap legends and annotation legends, but in a same category, the legends are always grouped and plotted together.

Maybe also

draw(myHeatmap, annotation_legend_side = c(legend1 = "top", legend2 = "left", legend3="right", 
    legend4 = "topleft", legend5 = "topright", ...))

just kidding :)

I will think about it and improve the legend (at least the spacing between legends).

jokergoo avatar Jun 18 '22 08:06 jokergoo