% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/geoms-base.R
\name{geom_rect}
\alias{geom_rect}
\title{Rectangles}
\usage{
geom_rect(
  mapping = NULL,
  data = NULL,
  color = NULL,
  alpha = NULL,
  linewidth = NULL,
  border = NULL
)
}
\arguments{
\item{mapping, data}{Standard layer overrides. Requires \code{xmin}, \code{xmax},
\code{ymin} and \code{ymax}.}

\item{color}{Fill colour when \code{color} is not mapped.}

\item{alpha}{Fill opacity.}

\item{linewidth}{Border width in px; \code{0} (default) draws no border.}

\item{border}{Border colour when \code{linewidth > 0}.}
}
\value{
A \link{Layer} to add with \code{+}.
}
\description{
Draws an axis-aligned rectangle per row from explicit corners. Use it for
highlight bands, annotation boxes, and any hand-placed block; for a
regular grid shaded by value use \code{\link[=geom_tile]{geom_tile()}}.
}
\examples{
d <- data.frame(x1 = c(1, 3), x2 = c(2, 5), y1 = c(1, 2), y2 = c(4, 3))
ggnext(d, aes(xmin = x1, xmax = x2, ymin = y1, ymax = y2)) + geom_rect()
}
