% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/validate.R
\name{validate_plot}
\alias{validate_plot}
\title{Check a plot for common statistical-graphics mistakes}
\usage{
validate_plot(plot)
}
\arguments{
\item{plot}{A \link{GgnextPlot} object.}
}
\value{
An object of class \code{ggnext_check}: a list of findings, each with
\code{rule}, \code{status} (currently always \code{"warn"}), and \code{message}. Prints as
a short report; empty when nothing was found.
}
\description{
Runs a small set of rules over a plot's layers and scales - an empty
plot, a continuous geom (\code{geom_point()}, \code{geom_line()}, ...) mapped to a
categorical \code{y}, a mapped aesthetic that is mostly missing, a discrete
color/fill scale with more levels than a legend can usefully show, and a
\code{sqrt}-transformed scale fed negative values. Each is a heuristic, not a
guarantee - \code{validate_plot()} reports what commonly goes wrong, not what
is definitely wrong with this particular plot.
}
\examples{
p <- ggnext(mtcars, aes(mpg, as.character(cyl))) + geom_point()
validate_plot(p)
}
