Last chance! 50% off unlimited learning
Sale ends in
ltt.plot(phy, xlab = "Time", ylab = "N", ...)
ltt.lines(phy, ...)
mltt.plot(phy, ..., dcol = TRUE, dlty = FALSE,
legend = TRUE, xlab = "Time", ylab = "N")
"phylo"
; this could be an object
of class c("multi.tree", "phylo")
in the case of
mltt.plot
.ltt.plot()
and ltt.lines()
these are further (graphical) arguments to be passed to
plot()
or lines()
, respectively (see Details:
on how to transform the axes); inTRUE
).FALSE
).ltt.plot
does a simple lineages through time (LTT)
plot. Additional arguments (...
) may be used to change, for
instance, the limits on the axes (with xlim
and/or
ylim
) or other graphical settings (col
for the color,
lwd
for the line thickness, lty
for the line type may be
useful; see par
for an exhaustive listing of
graphical parameters). The $y$-axis can be log-transformed by
adding the following option: log = "y"
. ltt.lines
adds a LTT curve to an existing plot. Additional
arguments (...
) may be used to change the settings of the added
line. Of course, the settings of the already existing LTT plot cannot
be altered this way.
mltt.plot
does a multiple LTT plot taking as arguments one or
several trees. These trees may be given as objects of class
"phylo"
(single trees) or c("multi.tree", "phylo")
(multiple trees). Any number of objects may be given. This function is
mainly for exploratory analyses with the advantages that the axes are
set properly to view all lines, and the legend is plotted by
default. For more flexible settings of line drawings, it is probably
better to combine ltt.plot()
with successive calls of
ltt.lines()
(see Examples:
).
Nee, S., Holmes, E. C., Rambaut, A. and Harvey, P. H. (1995) Inferring population history from molecular phylogenies. Philosophical Transactions of the Royal Society of London. Series B. Biological Sciences, 349, 25--31.
skyline
, branching.times
,
birthdeath
, bd.ext
, yule.cov
plot
for the basic plotting function in Rdata(bird.families)
data(bird.orders)
opar <- par(mfrow = c(2, 1))
ltt.plot(bird.families)
title("Lineages Through Time Plot of the Bird Families")
ltt.plot(bird.families, log = "y")
title(main = "Lineages Through Time Plot of the Bird Families",
sub = "(with logarithmic transformation of the y-axis)")
par(opar)
### to plot the tree and the LTT plot together
layout(matrix(1:4, 2, 2))
plot(bird.families, show.tip.label = FALSE)
ltt.plot(bird.families, main = "Bird families")
plot(bird.orders, show.tip.label = FALSE)
ltt.plot(bird.orders, main = "Bird orders")
layout(matrix(1))
mltt.plot(bird.families, bird.orders)
### Generates 10 random trees with 23 tips:
TR <- replicate(10, rcoal(23), FALSE)
### Give names to each tree:
names(TR) <- paste("random tree", 1:10)
### And specify the class of the list so that mltt.plot()
### does not trash it!
class(TR) <- c("multi.tree", "phylo")
mltt.plot(TR)
### And now for something (not so) completely different:
ltt.plot(bird.orders, lwd = 2)
lapply(TR, ltt.lines, lty = 2) # same as:
### for (i in 1:10) ltt.lines(TR[[i]], lty = 2)
legend(-10, 5, lwd = c(2, 1), lty = c(1, 2), bty = "n",
legend = c("Bird orders", "Random trees"))
Run the code above in your browser using DataLab