wilkelab / cowplot

cowplot: Streamlined Plot Theme and Plot Annotations for ggplot2
https://wilkelab.org/cowplot/
704 stars 84 forks source link

Feature request: adding layers to plot_grid() #139

Closed privefl closed 5 years ago

privefl commented 5 years ago

I'm using e.g.

library(ggplot2)
cowplot::plot_grid(
  qplot(Sepal.Length, Sepal.Width, data = iris),
  qplot(Petal.Length, Petal.Width, data = iris)
)

and see that the resulting object is a ggplot object.

So, I would like to do something like

cowplot::plot_grid(
  qplot(Sepal.Length, Sepal.Width, data = iris),
  qplot(Petal.Length, Petal.Width, data = iris)
) + xlim(5, NA)

that would be equivalent to

cowplot::plot_grid(
  qplot(Sepal.Length, Sepal.Width, data = iris) + xlim(5, NA),
  qplot(Petal.Length, Petal.Width, data = iris) + xlim(5, NA)
)

Do you think it would be feasible?

clauswilke commented 5 years ago

No, this will never be possible. plot_grid() essentially takes a snapshot of a plot and turns it into an image. At this point, no further modifications are possible.

What you're requesting may be in scope for patchwork.