% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/UserFacingCoreFunctions.R
\name{ggplotplus_to_cowplot}
\alias{ggplotplus_to_cowplot}
\title{Convert a ggplotplus plot into a grob}
\usage{
ggplotplus_to_cowplot(plot)
}
\arguments{
\item{plot}{A ggplot or ggplotplus plot object.}
}
\value{
A grob object suitable for use with grid-based plotting utilities
such as \code{cowplot::plot_grid()}.
}
\description{
Convenience helper for converting ggplotplus plot objects into grobs using
\code{ggplot2::ggplotGrob()}.
}
\details{
This is primarily intended for compatibility with packages such as
\pkg{cowplot} that may not yet fully recognize custom S7 plot subclasses
during internal dispatch.
}
\examples{
p = ggplot2::ggplot(iris, ggplot2::aes(Sepal.Length, Petal.Length, colour = Species)) +
  geom_point_plus()

if(requireNamespace("cowplot", quietly = TRUE)) {

cowplot::plot_grid(
  ggplotplus_to_cowplot(p),
  ggplotplus_to_cowplot(p)
)
}

}
