]> git.donarmstrong.com Git - ape.git/blob - man/plot.ancestral.Rd
4279432860c0a01f268f8e300dd490fdd294a3c3
[ape.git] / man / plot.ancestral.Rd
1 \name{plot.ancestral}
2 \alias{plot.ancestral}
3 \title{Plot Ancestral Character Values on a Tree}
4 \description{
5   Plot a phylogenetic tree with edge colors picked according to the
6   corresponding node ancestral character value.
7 }
8 \usage{
9 \method{plot}{ancestral}(x, which = names(x$node.character), n.col = 10,
10 col.fun = function(n) rainbow(n, start = 0.4, end = 0),
11 plot.node.values = FALSE,
12 ask = prod(par("mfcol")) < length(which) && dev.interactive(),
13 ...)
14 }
15 \arguments{
16   \item{x}{An object of class 'ancestral'.}
17   \item{which}{Which characters to plot. Can be a vecotr of names, or a
18     vector of indices.}
19   \item{n.col}{The number of colors to use in the gradient.}
20   \item{col.fun}{the color function to use.}
21   \item{plot.node.values}{Should character values used as node labels?}
22   \item{ask}{Ask before each plot?}
23   \item{\dots}{Further parameters to pass to the plot.phylo function.}
24 }
25 \details{
26   This function produces one plot by selected ancestral character. It
27   uses the plot.phylo function with particular arguments to display edge
28   colors according to ancestral character values.
29 }
30 \author{Julien Dutheil \email{Julien.Dutheil@univ-montp2.fr}}
31 \seealso{
32   \code{\link{plot.phylo}}, \code{\link{evolve.phylo}}
33 }
34 \examples{
35 data(bird.orders)
36 x <- rep(0, 4)
37 names(x) <- c("A", "B", "C", "D")
38 anc <- evolve.phylo(bird.orders, x, 1)
39 plot(anc, edge.width = 3, plot.node.values = TRUE)
40 par(mfrow = c(2, 2), mar = c(5.5, 0, 0, 0))
41 plot(anc, edge.width = 3, type = "r")
42 }
43 \keyword{hplot}