I am trying to combine two ggplot objects with cowplot::plot_grid()and vertically align them. This is usually pretty simple using align = "v".
dat1 <- data.frame(x = rep(1:10, 2), y = 1:20)
dat2 <- data.frame(x = 1:10, y = 1:10)
plot1 <- ggplot(dat1, aes(x = x, y = y)) + geom_point()
plot2 <- ggplot(dat2, aes(x = x, y = y)) + geom_point()
cowplot::plot_grid(plot1, plot2, ncol = 1, align = "v")

However, this approach does not work when ggplots are used coord_equal()because it plot_grid()cannot change the axes when formatting. Instead, the default value is to keep the height of each graph.
plot1 <- ggplot(dat1, aes(x = x, y = y)) + geom_point() + coord_equal()
plot2 <- ggplot(dat2, aes(x = x, y = y)) + geom_point() + coord_equal()
cowplot::plot_grid(plot1, plot2, ncol = 1, align = "v")

I can get my goal to play with and get the argument rel_heightsin order, but this is not a viable solution since I have a lot of dynamic builds. Here, the y axes are aligned, and the coordinates of all the axes are still equal.
cowplot::plot_grid(plot1, plot2, ncol = 1, align = "v", rel_heights = c(2, 1.07))

, ggplot2::ggplotGrob() grid::grid_draw(), coord_equal() . , cowplot::plot_grid(), , , - rel_heights. , , , cowplot::plot_grid(). , - .