How to manage multiple legends in heatmap_legend_param (ComplexHeatmap) ?
1
0
Entering edit mode
g.atla ▴ 10
@gatla-9491
Last seen 4.7 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.

 

ComplexHeatmap complexheatmap • 763 views
ADD COMMENT
0
Entering edit mode
g.atla ▴ 10
@gatla-9491
Last seen 4.7 years ago

I understood that the heatmap_legend_param is only for the heatmap and I need to use annotation_legend_param and I can specify nrow and ncol to get the desired format and then I can place them at the bottom using annotation_legend_side = "bottom"

ADD COMMENT

Login before adding your answer.

Traffic: 463 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6