% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plotly_Utils.R
\name{plotlygg}
\alias{plotlygg}
\title{Convert a plotly object to ggplot}
\usage{
plotlygg(p, print = TRUE)
}
\arguments{
\item{p}{A plotly object to convert.}

\item{print}{If \code{TRUE} (the default), will print the ggplot object and invisibly return it.}
}
\value{
A ggplot object.
}
\description{
\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#stable}{\figure{lifecycle-stable.svg}{options: alt='[Stable]'}}}{\strong{[Stable]}}
Converts a plotly object to a ggplot object. It is the inverse of \code{\link[plotly:ggplotly]{plotly::ggplotly()}}.
}
\details{
This function extracts the data and layout from a plotly object
and constructs a ggplot object with the same data.
It supports various trace types including scatter, bar, and line traces.
}
