Is there an easy way to move the legend to the right using ComplexHeatmap, so that it doesn't overlap with the row names? I have read the documentation, but am struggling to find the appropriate argument. The main heatmap code is below, along with a plot example.
annotation_col <- HeatmapAnnotation(
Timepoint = metadata$timepoint,
col = list(Timepoint = time_cols),
show_legend = TRUE,
show_annotation_name = FALSE,
simple_anno_size = unit(4, "mm"),
annotation_name_gp = gpar(fontsize = 11))
my_heatmap <- Heatmap(
my_matrix,
col = colorRampPalette(rev(
RColorBrewer::brewer.pal(n = 7, name = "RdYlBu")))(100),
show_column_names = FALSE,
top_annotation = annotation_col,
row_names_gp = gpar(fontsize = 10, fontface = 1),
column_title_gp = gpar(fontsize = 14),
heatmap_legend_param = list(
title = "Activity",
title_gp = gpar(fontsize = 11),
labels_gp = gpar(fontsize = 11)),
split = 3,
row_title = NULL)
Is it possible to use the 'width' argument and then shift the whole heatmap to the left? Or is the only option to truncate the row names?
Great, thank you. The
row_names_max_width
argument seems to have worked!