\Header{plot.diana}{Plots of a Divisive Hierarchical Clustering}
\keyword{cluster}{plot.diana}
\keyword{hplot}{plot.diana}
\begin{Description}\relax
Creates plots for visualizing a \code{diana} object.
\end{Description}
\begin{Usage}
\begin{verbatim}
## S3 method for class 'diana':
plot(x, ask = FALSE, which.plots = NULL, main = NULL,
           sub = paste("Divisive Coefficient = ", round(x$dc, digits = 2)),
           adj = 0, nmax.lab = 35, max.strlen = 5, xax.pretty = TRUE, ...)
\end{verbatim}
\end{Usage}
\begin{Arguments}
\begin{ldescription}
\item[\code{x}] an object of class \code{"diana"}, typically created by
\code{\Link{diana}(.)}.
\item[\code{ask}] logical; if true and \code{which.plots} is \code{NULL},
\code{plot.diana} operates in interactive mode, via \code{\Link{menu}}.
\item[\code{which.plots}] integer vector or NULL (default), the latter
producing both plots.  Otherwise, \code{which.plots}
must contain integers of \code{1} for a \emph{banner} plot or \code{2} for a
dendrogramm or ``clustering tree''.
\item[\code{main, sub}] main and sub title for the plot, each with a convenient
default.  See documentation for these arguments in
\code{\Link{plot.default}}.
\item[\code{adj}] for label adjustment in \code{\Link{bannerplot}()}.
\item[\code{nmax.lab}] integer indicating the number of labels which is
considered too large for single-name labelling the banner plot.
\item[\code{max.strlen}] positive integer giving the length to which
strings are truncated in banner plot labeling.
\item[\code{xax.pretty}] logical or integer indicating if
\code{\Link{pretty}(*, n = xax.pretty)} should be used for the x axis.
\code{xax.pretty = FALSE} is for back compatibility.
\item[\code{...}] graphical parameters (see \code{\Link{par}}) may also
be supplied and are passed to \code{\Link{bannerplot}()} or
\code{\Link{pltree}()}, respectively.
\end{ldescription}
\end{Arguments}
\begin{Details}\relax
When \code{ask = TRUE}, rather than producing each plot sequentially,
\code{plot.diana} displays a menu listing all the plots that can be produced.
If the menu is not desired but a pause between plots is still wanted
one must set \code{par(ask= TRUE)} before invoking the plot command.

The banner displays the hierarchy of clusters, and is equivalent to a tree.
See Rousseeuw (1986) or chapter 6 of Kaufman and Rousseeuw (1990).
The banner plots the diameter of each cluster being splitted.
The observations are listed in the order found by the \code{diana}
algorithm, and the numbers in the \code{height} vector are represented
as bars between the observations.

The leaves of the clustering tree are the original observations.
A branch splits up at the diameter of the cluster being splitted.
\end{Details}
\begin{Section}{Side Effects}
An appropriate plot is produced on the current graphics device. This can
be one or both of the following choices:
\\ Banner
\\ Clustering tree
\end{Section}
\begin{Note}\relax
In the banner plot,
observation labels are only printed when the number of observations is
limited less than \code{nmax.lab} (35, by default), for readability.
Moreover, observation labels are truncated to maximally
\code{max.strlen} (5) characters.
\end{Note}
\begin{References}\relax
see those in \code{\Link{plot.agnes}}.
\end{References}
\begin{SeeAlso}\relax
\code{\Link{diana}}, \code{\Link{diana.object}},
\code{\Link{twins.object}}, \code{\Link{par}}.
\end{SeeAlso}
\begin{Examples}
\begin{ExampleCode}
example(diana)# -> dv <- diana(....)

plot(dv, which = 1, nmax.lab = 100)

## wider labels :
op <- par(mar = par("mar") + c(0, 2, 0,0))
plot(dv, which = 1, nmax.lab = 100, max.strlen = 12)
par(op)
\end{ExampleCode}
\end{Examples}

