MyNixOS website logo
Description

A 'ggplot2' Extension for Consistent Axis Alignment.

A 'ggplot2' extension offers various tools the creation of complex, multi-plot visualizations. Built on the familiar grammar of graphics, it provides intuitive tools to align and organize plots, making it ideal for complex visualizations. It excels in multi-omics research—such as genomics and microbiomes—by simplifying the visualization of intricate relationships between datasets, for example, linking genes to pathways. Whether you need to stack plots, arrange them around a central figure, or create a circular layout, 'ggalign' delivers flexibility and accuracy with minimal effort.

ggalign ggalign website

R-CMD-check Codecov testcoverage CRANstatus Project Status: Active - The project has reached a stable, usablestate and is being activelydeveloped. DOI

The ggalign package extends ggplot2 to simplify the creation of complex, multi-plot visualizations. Built on the familiar grammar of graphics, it provides intuitive tools to align and organize plots—such as heatmaps, dendrograms, or circular layouts—while handling intricate relationships in multi-omics data, like genomics or microbiomes. Whether you need to stack plots, arrange them around a central figure, or link diverse datasets (e.g., genes to pathways), ggalign offers flexibility and precision with minimal effort.

Why use ggalign?

ggalign focuses on aligning observations across multiple plots. If you’ve ever struggled with aligning plots with self-contained ordering (like dendrogram), or applying consistent grouping or ordering across multiple plots (e.g., with k-means clustering), ggalign is designed to make this easier. The package integrates seamlessly with ggplot2, providing the flexibility to use its geoms, scales, and other components for complex visualizations.

Installation

You can install ggalign from CRAN using:

install.packages("ggalign")

Alternatively, install the development version from r-universe with:

install.packages("ggalign",
    repos = c("https://yunuuuu.r-universe.dev", "https://cloud.r-project.org")
)

or from GitHub with:

# install.packages("remotes")
remotes::install_github("Yunuuuu/ggalign")

Learning ggalign

  1. For the full reference documentation, visit: https://yunuuuu.github.io/ggalign/
  2. The complete tutorial is available at: https://yunuuuu.github.io/ggalign-book/

Design features

Examples

Comparison with other composable visualization tools

ggalignmarsileaComplexHeatmap
LanguageRPythonR
User InterfaceDeclarativeDeclarativeFunctional
Plot Systemggplot2 (Advanced plot system built on grid system)Matplotlibgrid
FocusGeneral-purpose composable visualizationGrid-based composable visualizationHeatmap
StackLayout
QuadLayoutHeatmap Only (discrete variables)
CircleLayout
RelationshipOne-to-One
One-to-Many/Many-to-One
Many-to-Many
Crosswise
Annotate observations
Fully Compatible with ggplot2

Feature and specification comparison

SpecificationggalignmarsileaComplexHeatmap
Reorder observationsHeatmap Only
Group observations into different panelsHeatmap Only
Clustering algorithmKmeans,Hierarchical Clustering and arbitary algorithmKmeans,Hierarchical Clustering and arbitary algorithm
Legends CreationAutomaticAutomaticLimited automatic, requires manual add
Legends PositionAnywhere; independently controllable per plotAnywhereFixed to one of four sides
DendrogramTree from both hclust or apehclust onlyhclust only
Tanglegram
3D Heatmap
Oncoplot
UpSet plot

Acknowledgements

I would like to express my sincere gratitude to the contributors of the ggplot2 project for providing a powerful and flexible framework for data visualization in R. Their work laid the foundation for the functionality and design of this package. I would also like to thank the patchwork project, from which the core coding for the plot composer was adapted. The patchwork library provided a useful mechanism for combining and aligning plots, which was modified to suit the needs of this package. Without the contributions of these open-source projects, this package would not have been possible.

Additionally, I would like to extend my heartfelt thanks to @teunbrand, who has fulfilled my numerous feature requests, and assisted with the integration of new functions into ggplot2.

Metadata

Version

1.0.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows