Skip to content

Instantly share code, notes, and snippets.

@pormr
Created May 13, 2026 08:39
Show Gist options
  • Select an option

  • Save pormr/a23be31799745128d844f3d7b20b7a2c to your computer and use it in GitHub Desktop.

Select an option

Save pormr/a23be31799745128d844f3d7b20b7a2c to your computer and use it in GitHub Desktop.
Create aligned version of ggplot objects in place (requires {{patchwork}})
align_plots <- function(...) {
x <- patchwork::align_patches(lapply(rlang::ensyms(..., .named = TRUE), get))
rlang::env_bind(parent.frame(), !!!x)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment