I recently developed a ggplot2 extension ggalign by providing advanced tools for aligning and organizing multiple plots, particularly those that automatically reorder observations, such as dendrogram. It offers fine control over layout adjustment and plot annotations, enabling you to create complex, publication-quality visualizations while still using the familiar grammar of ggplot2.
If you are interested, please check it out at https://github.com/Yunuuuu/ggalign and I would really appreciate it if you could leave a star!
For documents of the release version, please see https://yunuuuu.github.io/ggalign/, for documents of the development version, please see https://yunuuuu.github.io/ggalign/dev/. The development version now seamlessly integrates with maftools and supports magick rasterization.
Here is a summary graphic for what ggalign can do!
Welcom feature request and issues
If you can get it to play nicely with plotly's
ggplotly()
function, that'd be pretty neato.Sorry, the internal will build a patchwork firstly, but
plotly
doesn't support thepatchwork
. So it's not possible for this to work withggplotly
. Please see https://github.com/plotly/plotly.R/issues/2028 for detailsCan you plot faceted heat maps with this? i.e. If I create n heat maps... I can use do.call/grid.arrange to plot them all on 1 image, but it is awkward, and I still can't figure out how to add a main title, you need R(KungFuSkills) for that.
Yes, it internally use facet to plot the heatmap groups. The dendrogram will be aligned well with any ggplot objects (Just use the
ggalign
function to create aggplot
plot) in the facet layout.I have changed the default theme, and it can support connect multiple heatmap horizontally or vertically.
Because it can now align a
dendrogram
in a standard ggplot2 plot, enhancing its versatility, and it has been renamed into ggalign:Created on 2024-07-17 with [reprex v2.1.0](https://reprex.tidyverse.org) ~
layout_stack
put plots horizontally or vertically. You can also use the aliasggstack
.