\HeaderA{plot.factor}{Plotting Factor Variables}{plot.factor}
\keyword{hplot}{plot.factor}
\begin{Description}\relax
This functions implements a scatterplot method for
\code{\LinkA{factor}{factor}} arguments of the \emph{generic}
\code{\LinkA{plot}{plot}} function.

If \code{y} is missing \code{\LinkA{barplot}{barplot}} is produced.
For numeric \code{y} a \code{\LinkA{boxplot}{boxplot}} is used, and for a factor
\code{y} a \code{\LinkA{spineplot}{spineplot}} is shown.  For any other type of
\code{y} the next \code{plot} method is called, normally
\code{\LinkA{plot.default}{plot.default}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'factor':
plot(x, y, legend.text = NULL, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x, y}] numeric or factor. \code{y} may be missing.
\item[\code{legend.text}] character vector for annotation of y axis in the
case of a factor \code{y}: defaults to \code{levels(y)}.  This
sets the \code{yaxlabels} argument of \code{\LinkA{spineplot}{spineplot}}.
\item[\code{...}] Further arguments to \code{\LinkA{barplot}{barplot}},
\code{\LinkA{boxplot}{boxplot}}, \code{\LinkA{spineplot}{spineplot}} or
\code{\LinkA{plot}{plot}} as appropriate.  All of these accept graphical
parameters, see \code{\LinkA{par}{par}}, and annotation arguments passed
to \code{\LinkA{title}{title}}.  None accept \code{type}.

\end{ldescription}
\end{Arguments}
\begin{SeeAlso}\relax
\code{\LinkA{plot.default}{plot.default}}, \code{\LinkA{plot.formula}{plot.formula}},
\code{\LinkA{barplot}{barplot}}, \code{\LinkA{boxplot}{boxplot}}, \code{\LinkA{spineplot}{spineplot}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
require(grDevices)
plot(weight ~ group, data = PlantGrowth)         # numeric vector ~ factor
plot(cut(weight, 2) ~ group, data = PlantGrowth) # factor ~ factor
## passing "..." to spineplot() eventually:
plot(cut(weight, 3) ~ group, data = PlantGrowth,
     col = hcl(c(0, 120, 240), 50, 70))

plot(PlantGrowth$group, axes=FALSE, main="no axes")# extremely silly
\end{ExampleCode}
\end{Examples}

