]> git.donarmstrong.com Git - ape.git/blob - man/ltt.plot.Rd
a36ec22c52a8ccaa6af622b5edda8c3b342d7917
[ape.git] / man / ltt.plot.Rd
1 \name{ltt.plot}
2 \alias{ltt.plot}
3 \alias{ltt.lines}
4 \alias{mltt.plot}
5 \title{Lineages Through Time Plot}
6 \usage{
7 ltt.plot(phy, xlab = "Time", ylab = "N", ...)
8 ltt.lines(phy, ...)
9 mltt.plot(phy, ..., dcol = TRUE, dlty = FALSE, legend = TRUE,
10           xlab = "Time", ylab = "N", log = "")
11 }
12 \arguments{
13   \item{phy}{an object of class \code{"phylo"}; this could be an object
14     of class \code{"multiPhylo"} in the case of \code{mltt.plot}.}
15   \item{xlab}{a character string (or a variable of mode character)
16     giving the label for the x-axis (default is "Time").}
17   \item{ylab}{idem for the y-axis (default is "N").}
18   \item{\dots}{in the cases of \code{ltt.plot()} and \code{ltt.lines()}
19     these are further (graphical) arguments to be passed to
20     \code{plot()} or \code{lines()}, respectively (see \code{Details:}
21     on how to transform the axes); in the case \code{mltt.plot()} these
22     are additional trees to be plotted (see \code{Details:}).}
23   \item{dcol}{a logical specifying whether the different curves should
24     be differentiated with colors (default is \code{TRUE}).}
25   \item{dlty}{a logical specifying whether the different curves should
26     be differentiated with patterns of dots and dashes (default is
27     \code{FALSE}).}
28   \item{legend}{a logical specifying whether a legend should be
29     plotted.}
30   \item{log}{a character string specifying which axis(es) to be
31     log-transformed; must be one of the followings: \code{""},
32     \code{"x"}, \code{"y"}, or \code{"xy"}.}
33 }
34 \description{
35   These functions plot, on the current graphical device, the minimum
36   numbers of lineages through time from phylogenetic trees.
37 }
38 \details{
39   \code{ltt.plot} does a simple lineages through time (LTT)
40   plot. Additional arguments (\code{...}) may be used to change, for
41   instance, the limits on the axes (with \code{xlim} and/or
42   \code{ylim}) or other graphical settings (\code{col} for the color,
43   \code{lwd} for the line thickness, \code{lty} for the line type may be
44   useful; see \code{\link[graphics]{par}} for an exhaustive listing of
45   graphical parameters). The \eqn{y}-axis can be log-transformed by
46   adding the following option: \code{log = "y"}.
47
48   \code{ltt.lines} adds a LTT curve to an existing plot. Additional
49   arguments (\code{...}) may be used to change the settings of the added
50   line. Of course, the settings of the already existing LTT plot cannot
51   be altered this way.
52
53   \code{mltt.plot} does a multiple LTT plot taking as arguments one or
54   several trees. These trees may be given as objects of class
55   \code{"phylo"} (single trees) or \code{"multiPhylo"} (multiple
56   trees). Any number of objects may be given. This function is mainly
57   for exploratory analyses with the advantages that the axes are set
58   properly to view all lines, and the legend is plotted by default. For
59   more flexible settings of line drawings, it is probably better to
60   combine \code{ltt.plot()} with successive calls of \code{ltt.lines()}
61   (see \code{Examples:}).
62 }
63 \references{
64   Harvey, P. H., May, R. M. and Nee, S. (1994) Phylogenies without
65   fossils. \emph{Evolution}, \bold{48}, 523--529.
66
67   Nee, S., Holmes, E. C., Rambaut, A. and Harvey, P. H. (1995) Inferring
68   population history from molecular phylogenies. \emph{Philosophical
69     Transactions of the Royal Society of London. Series B. Biological
70     Sciences}, \bold{349}, 25--31.
71 }
72 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
73 \seealso{
74   \code{\link{skyline}}, \code{\link{branching.times}},
75   \code{\link{birthdeath}}, \code{\link{bd.ext}}, \code{\link{yule.cov}}
76   \code{\link[graphics]{plot}} for the basic plotting function in R
77 }
78 \examples{
79 data(bird.families)
80 data(bird.orders)
81 opar <- par(mfrow = c(2, 1))
82 ltt.plot(bird.families)
83 title("Lineages Through Time Plot of the Bird Families")
84 ltt.plot(bird.families, log = "y")
85 title(main = "Lineages Through Time Plot of the Bird Families",
86       sub = "(with logarithmic transformation of the y-axis)")
87 par(opar)
88 ### to plot the tree and the LTT plot together
89 layout(matrix(1:4, 2, 2))
90 plot(bird.families, show.tip.label = FALSE)
91 ltt.plot(bird.families, main = "Bird families")
92 plot(bird.orders, show.tip.label = FALSE)
93 ltt.plot(bird.orders, main = "Bird orders")
94 layout(matrix(1))
95 mltt.plot(bird.families, bird.orders)
96 ### Generates 10 random trees with 23 tips:
97 TR <- replicate(10, rcoal(23), FALSE)
98 ### Give names to each tree:
99 names(TR) <- paste("random tree", 1:10)
100 ### And specify the class of the list so that mltt.plot()
101 ### does not trash it!
102 class(TR) <- "multiPhylo"
103 mltt.plot(TR, bird.orders)
104 ### And now for something (not so) completely different:
105 ltt.plot(bird.orders, lwd = 2)
106 for (i in 1:10) ltt.lines(TR[[i]], lty = 2)
107 legend(-10, 5, lwd = c(2, 1), lty = c(1, 2), bty = "n",
108        legend = c("Bird orders", "Random trees"))
109 }
110 \keyword{hplot}
111 \keyword{aplot}