Arranges both dendrograms with heatmap.

arrange_dendrogram(
  heatmap,
  dendrogram_top,
  dendrogram_right,
  top_right = NULL,
  widths = c(0.8, 0.2),
  heights = c(0.2, 0.8)
)

Arguments

heatmap

object containing heatmap plot

dendrogram_top

top dendrogram plot generated with plot_dendrogram

dendrogram_right

right dendrogram plot generated with plot_dendrogram

top_right

element placed in the top right part of the plot. By default NULL leaving empty space.

widths

numeric vector of heatmap and right dendrogram widths

heights

numeric vector of top dendrogram and heatmap heights

Value

plot with heatmap and aligned dendrograms

Examples

library(ggplot2) data(example_data) dendro_top <- plot_dendrogram(d1) dendro_right <- plot_dendrogram(d2) + coord_flip() # Plot aligned dendrograms with legend at the bottom arrange_dendrogram(hm + theme_bw() + theme(legend.position = "bottom"), dendro_top + theme_void(), dendro_right + theme_void())
# Plot aligned dendrograms with legend in the top right corner arrange_dendrogram(hm + theme_bw() + theme(legend.position = "none"), dendro_top + theme_void(), dendro_right + theme_void(), get_legend(hm))