\HeaderA{truehist}{Plot a Histogram}{truehist}
\keyword{hplot}{truehist}
\keyword{dplot}{truehist}
\begin{Description}\relax
Creates a histogram on the current graphics device.
\end{Description}
\begin{Usage}
\begin{verbatim}
truehist(data, nbins = "Scott", h, x0 = -h/1000,
         breaks, prob = TRUE, xlim = range(breaks),
         ymax = max(est), col,
         xlab = deparse(substitute(data)), bty = "n", ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{data}] numeric vector of data for histogram.  Missing values (\code{NA}s)
are allowed and omitted.

\item[\code{nbins}] The suggested number of bins.  Either a positive integer, or a character string
naming a rule: \code{"Scott"} or \code{"Freedman-Diaconis"} or \code{"FD"}.  (Case is
ignored.)

\item[\code{h}] The bin width, a strictly positive number (takes precedence over \code{nbins}).

\item[\code{x0}] Shift for the bins - the breaks are at \code{x0 + h * (..., -1, 0, 1, ...)}

\item[\code{breaks}] The set of breakpoints to be used. (Usually omitted, takes precedence
over \code{h} and \code{nbins}).

\item[\code{prob}] If true (the default) plot a true histogram.
The vertical axis has a
\emph{relative frequency density}
scale, so the product of the dimensions of any panel gives the
relative frequency.  Hence the total area under the histogram
is 1 and it is directly comparable with most other estimates
of the probability density function.
If false plot the counts in the bins.

\item[\code{xlim}] The limits for the x-axis.

\item[\code{ymax}] The upper limit for the y-axis.

\item[\code{col}] The colour number for the bar fill.

\item[\code{xlab}] label for the plot x-axis. By default, this will be the name of \code{data}.

\item[\code{bty}] The box type for the plot - defaults to none.

\item[\code{...}] additional arguments to \code{\LinkA{rect}{rect}} or \code{\LinkA{plot}{plot}}.

\end{ldescription}
\end{Arguments}
\begin{Details}\relax
This plots a true histogram, a density estimate of total area 1.  If
\code{breaks} is specified, those breakpoints are used. Otherwise if
\code{h} is specified, a regular grid of bins is used with width
\code{h}.  If neither \code{breaks} nor \code{h} is specified,
\code{nbins} is used to select a suitable \code{h}.
\end{Details}
\begin{Section}{Side Effects}
A histogram is plotted on the current device.
\end{Section}
\begin{References}\relax
Venables, W. N. and Ripley, B. D. (2002)
\emph{Modern Applied Statistics with S.} Fourth edition.  Springer.
\end{References}
\begin{SeeAlso}\relax
\code{\LinkA{hist}{hist}}
\end{SeeAlso}

