\HeaderA{ggcontour}{Grob function: contours}{ggcontour}
\keyword{hplot}{ggcontour}
\begin{Description}\relax
Create a grob to display contours of a 3D data set.
\end{Description}
\begin{Usage}
\begin{verbatim}ggcontour(plot = .PLOT, aesthetics=list(), ..., data=plot$data)\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{plot}] the plot object to modify
\item[\code{aesthetics}] named list of aesthetic mappings, see details for more information
\item[\code{...}] other options, see details for more information
\item[\code{data}] data source, if not specified the plot default will be used
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
Aesthetic mappings that this grob function understands:

\Itemize{
\item x: x position (required)
\item y: y position (required)
\item z: z position (required)
}

These can be specified in the plot defaults (see \code{\LinkA{ggplot}{ggplot}}) or
in the \code{aesthetics} argument.  If you want to modify the position
of the points or any axis options, you will need to add a position scale to
the plot.  These functions start with \code{ps}, eg.
\code{\LinkA{pscontinuous}{pscontinuous}} or \code{\LinkA{pscategorical}{pscategorical}}

Other options:

\Itemize{
\item nlevels: number of contours to draw
\item levels: contour positions
}
\end{Details}
\begin{Author}\relax
Hadley Wickham <h.wickham@gmail.com>
\end{Author}
\begin{SeeAlso}\relax
\code{\LinkA{gg2density}{gg2density}}
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}volcano3d <- data.frame(expand.grid(x = 1:nrow(volcano), y=1:ncol(volcano)), z=as.vector(volcano))
p <- ggplot(volcano3d, aesthetics=list(x=x,y=y,z=z))
ggcontour(p)
ggcontour(p, nlevels=3)
ggcontour(ggtile(p, list(colour=z)))\end{ExampleCode}
\end{Examples}

