79684077

Date: 2025-06-29 21:49:26
Score: 2
Natty:
Report link

Would you try patchwork and cowplot?

library(ggplot2)
library(patchwork)

p1 <- ggplot(data.frame(x = 2000:2020, y = rnorm(21)), aes(x, y)) +
geom_line() +
theme_classic()

p2 <- ggplot(data.frame(x = 1:15, y = runif(15)), aes(x, y)) +
geom_bar(stat = "identity") +
theme_classic()

library(cowplot)

plot_grid(p1, p2, rel_widths = c(1, 1), align = "v", axis = "tb")
Reasons:
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Low reputation (0.5):
Posted by: MetehanGungor