\Header{grid.rect}{Draw rectangles}
\alias{rectGrob}{grid.rect}
\keyword{dplot}{grid.rect}
\begin{Description}\relax
These functions create and draw rectangles.
\end{Description}
\begin{Usage}
\begin{verbatim}
grid.rect(x = unit(0.5, "npc"), y = unit(0.5, "npc"),
      width = unit(1, "npc"), height = unit(1, "npc"),
      just = "centre", default.units = "npc", name = NULL,
      gp=gpar(), draw = TRUE, vp = NULL)
rectGrob(x = unit(0.5, "npc"), y = unit(0.5, "npc"),
      width = unit(1, "npc"), height = unit(1, "npc"),
      just = "centre", default.units = "npc", name = NULL,
      gp=gpar(), vp = NULL)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] A numeric vector or unit object specifying x-location.
\item[\code{y}] A numeric vector or unit object specifying y-location.
\item[\code{width}] A numeric vector or unit object specifying width.
\item[\code{height}] A numeric vector or unit object specifying height.
\item[\code{just}] The justification of the rectangle about its (x, y)
location.  If two values are given, the first specifies
horizontal justification and the second specifies vertical
justification.
\item[\code{default.units}] A string indicating the default units to use
if \code{x}, \code{y}, \code{width}, or \code{height}
are only given as numeric vectors.
\item[\code{name}] A character identifier. 
\item[\code{gp}] An object of class \code{gpar}, typically the output
from a call to the function \code{gpar}.  This is basically
a list of graphical parameter settings.
\item[\code{draw}] A logical value indicating whether graphics output
should be produced.
\item[\code{vp}] A Grid viewport object (or NULL).
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Both functions create a rect grob (a graphical object describing
rectangles), but only \code{grid.rect}
draws the rectangles (and then only if \code{draw} is \code{TRUE}).
\end{Details}
\begin{Value}
A rect grob.  \code{grid.rect} returns the value invisibly.
\end{Value}
\begin{Author}\relax
Paul Murrell
\end{Author}
\begin{SeeAlso}\relax
\link{Grid},
\code{\Link{viewport}}
\end{SeeAlso}

