It would be nice to be able to check programmatically if a given ggplot is a plot_grid and what layout it has.
As-is, you basically have to try if any of the elements is a GeomDrawGrob and then painstakingly reassemble the layout from geom_params$xmin/xmax/....
This would be useful to write an alternative to save_plot that infers the number of rows/columns using abovementioned metadata or information from facets.
It would be nice to be able to check programmatically if a given ggplot is a
plot_grid
and what layout it has.As-is, you basically have to try if any of the elements is a
GeomDrawGrob
and then painstakingly reassemble the layout fromgeom_params$xmin/xmax/...
.This would be useful to write an alternative to
save_plot
that infers the number of rows/columns using abovementioned metadata or information from facets.