Entering edit mode
g.atla
▴
10
@gatla-9491
Last seen 7.9 years ago
I would like to know how can I manage multiple legends with heatmap_legend_param
?
My annotations looks like
head(colData)
purity Center Year BMI Gender sample1 75 Geneva 2011 20 F sample2 90 Milano 2011 <NA> F sample3 90 Lille 2011 30 M sample4 80 Lille 2012 20 M sample5 95 Miami 2011 <NA> M sample6 60 Geneva 2013 30 M ha = HeatmapAnnotation(df = colData, show_annotation_name=TRUE)
ht1 <- Heatmap(x, top_annotation=ha, cluster_rows=FALSE, cluster_columns=FALSE, col = colorRamp2(c(-3, 0, 3), c("green", "black", "red")), show_row_names=FALSE, heatmap_legend_param = list(color_bar = "continuous", legend_direction = "horizontal", legend_width = unit(5, "cm"), title_position = "lefttop")) draw(ht1, heatmap_legend_side = "bottom")
Here only the first legend gets printed at the bottom, but I would like to place all the legends either at the bottom or top as they do not fit properly on the right side.