Question: How to manage multiple legends in heatmap_legend_param (ComplexHeatmap) ?
0
gravatar for g.atla
3.1 years ago by
g.atla0
g.atla0 wrote:

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 • 595 views
ADD COMMENTlink modified 3.1 years ago • written 3.1 years ago by g.atla0
Answer: How to manage multiple legends in heatmap_legend_param (ComplexHeatmap) ?
0
gravatar for g.atla
3.1 years ago by
g.atla0
g.atla0 wrote:

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 COMMENTlink written 3.1 years ago by g.atla0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 414 users visited in the last hour