% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/facet.R
\name{facet_wrap}
\alias{facet_wrap}
\title{Wrap panels into a grid}
\usage{
facet_wrap(vars, ncol = NULL, nrow = NULL, scales = "fixed")
}
\arguments{
\item{vars}{Faceting variables: unquoted names (\code{facet_wrap(cyl)}),
a character vector, or several names.}

\item{ncol, nrow}{Force a panel-grid shape; \code{NULL} picks a near-square
layout.}

\item{scales}{\code{"fixed"} (all panels share axes — best for comparison),
\code{"free_x"}, \code{"free_y"}, or \code{"free"} (each panel scales to its own data).}
}
\value{
A \link{Facet} object to add to a plot with \code{+}.
}
\description{
Splits the data by one or more variables and lays the resulting panels
out in a rectangular grid, wrapping to a new row as needed.
}
\examples{
ggnext(iris, aes(Sepal.Length, Sepal.Width)) +
  geom_point() +
  facet_wrap(Species)
}
