Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Another useful free type: free_vp() #392

Open
Yunuuuu opened this issue Sep 13, 2024 · 0 comments
Open

Another useful free type: free_vp() #392

Yunuuuu opened this issue Sep 13, 2024 · 0 comments

Comments

@Yunuuuu
Copy link
Contributor

Yunuuuu commented Sep 13, 2024

knitr::opts_knit$set(upload.fun = identity)
library(ggalign)
#> Loading required package: ggplot2
library(ggplot2)
p1 <- ggplot(mtcars, aes(mpg)) +
  geom_density() +
  facet_wrap(~vs)


p2 <- ggplot(mtcars, aes(mpg)) +
  geom_density() +
  facet_wrap(~vs)

align_plots(p1, free_vp(p2,
  y = 0, height = unit(10, "cm"), just = "bottom"
), nrow = 1L)

image

Created on 2024-09-13 with reprex v2.1.0
~
~

I use free_vp to make justification for heatmap annotations, all annotation should be next to the heatmap body (instead of put the grob in the center of the gtable cell), see the boxplot in the red rect.

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant