% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/facet.R
\name{facet_grid}
\alias{facet_grid}
\title{Lay panels out in a rows-by-columns grid}
\usage{
facet_grid(rows, cols = NULL, scales = "fixed")
}
\arguments{
\item{rows}{Variable defining the panel rows (unquoted name or string).}

\item{cols}{Variable defining the panel columns; \code{NULL} for a single
column.}

\item{scales}{As in \code{\link[=facet_wrap]{facet_wrap()}}.}
}
\value{
A \link{Facet} object to add to a plot with \code{+}.
}
\description{
\code{facet_grid(rows, cols)} builds a two-way panel matrix: one row per level
of \code{rows}, one column per level of \code{cols}.
}
\examples{
d <- transform(mtcars, cyl = factor(cyl), am = factor(am))
ggnext(d, aes(disp, mpg)) + geom_point() + facet_grid(am, cyl)
}
