\HeaderA{plot.histogram}{Plot Histograms}{plot.histogram}
\aliasA{lines.histogram}{plot.histogram}{lines.histogram}
\keyword{hplot}{plot.histogram}
\keyword{iplot}{plot.histogram}
\begin{Description}\relax
These are methods for objects of class \code{"histogram"}, typically
produced by \code{\LinkA{hist}{hist}}.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'histogram':
plot(x, freq = equidist, density = NULL, angle = 45,
               col = NULL, border = par("fg"), lty = NULL,
               main = paste("Histogram of",
                            paste(x$xname, collapse="\n")),
               sub = NULL, xlab = x$xname, ylab,
               xlim = range(x$breaks), ylim = NULL,
               axes = TRUE, labels = FALSE, add = FALSE, ann = TRUE, ...)

## S3 method for class 'histogram':
lines(x, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] a \code{histogram} object, or a list with components
\code{density}, \code{mid}, etc, see \code{\LinkA{hist}{hist}} for
information about the components of \code{x}.
\item[\code{freq}] logical; if \code{TRUE}, the
histogram graphic is to present a representation of frequencies, i.e,
\code{x\$counts}; if \code{FALSE}, \emph{relative} frequencies
(probabilities), i.e., \code{x\$density}, are plotted.  The
default is true for equidistant \code{breaks} and false otherwise.
\item[\code{col}] a colour to be used to fill the bars.  The default of
\code{NULL} yields unfilled bars.
\item[\code{border}] the color of the border around the bars.
\item[\code{angle, density}] select shading of bars by lines:
see \code{\LinkA{rect}{rect}}.
\item[\code{lty}] the line type used for the bars, see also \code{\LinkA{lines}{lines}}.
\item[\code{main, sub, xlab, ylab}] these arguments to \code{title} have useful
defaults here.
\item[\code{xlim, ylim}] the range of x and y values with sensible defaults.
\item[\code{axes}] logical, indicating if axes should be drawn.
\item[\code{labels}] logical or character.  Additionally draw labels on top of bars,
if not \code{FALSE}; if \code{TRUE}, draw the counts or rounded
densities; if \code{labels} is a \code{character}, draw itself.
\item[\code{add}] logical.  If \code{TRUE}, only the bars are added to the
current plot.  This is what \code{lines.histogram(*)} does.
\item[\code{ann}] logical.  Should annotations (titles and axis titles) be plotted?
\item[\code{...}] further graphical parameters to \code{title} and \code{axis}.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
\code{lines.histogram(*)} is the same as
\code{plot.histogram(*, add = TRUE)}.
\end{Details}
\begin{SeeAlso}\relax
\code{\LinkA{hist}{hist}},
\code{\LinkA{stem}{stem}},
\code{\LinkA{density}{density}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
(wwt <- hist(women$weight, nclass = 7, plot = FALSE))
plot(wwt, labels = TRUE) # default main & xlab using wwt$xname
plot(wwt, border = "dark blue", col = "light blue",
     main = "Histogram of 15 women's weights", xlab = "weight [pounds]")

## Fake "lines" example, using non-default labels:
w2 <- wwt; w2$counts <- w2$counts - 1
lines(w2, col = "Midnight Blue", labels = ifelse(w2$counts, "> 1", "1"))
\end{ExampleCode}
\end{Examples}

