ape (version 2.3-1)

plot.ancestral: Plot Ancestral Character Values on a Tree

Description

Plot a phylogenetic tree with edge colors picked according to the corresponding node ancestral character value.

Usage

## S3 method for class 'ancestral':
plot(x, which = names(x$node.character), n.col = 10,
col.fun = function(n) rainbow(n, start = 0.4, end = 0),
plot.node.values = FALSE,
ask = prod(par("mfcol")) < length(which) && dev.interactive(),
...)

Arguments

x
An object of class 'ancestral'.
which
Which characters to plot. Can be a vecotr of names, or a vector of indices.
n.col
The number of colors to use in the gradient.
col.fun
the color function to use.
plot.node.values
Should character values used as node labels?
ask
Ask before each plot?
...
Further parameters to pass to the plot.phylo function.

Details

This function produces one plot by selected ancestral character. It uses the plot.phylo function with particular arguments to display edge colors according to ancestral character values.

See Also

plot.phylo, evolve.phylo

Examples

Run this code
data(bird.orders)
x <- rep(0, 4)
names(x) <- c("A", "B", "C", "D")
anc <- evolve.phylo(bird.orders, x, 1)
plot(anc, edge.width = 3, plot.node.values = TRUE)
par(mfrow = c(2, 2), mar = c(5.5, 0, 0, 0))
plot(anc, edge.width = 3, type = "r")

Run the code above in your browser using DataCamp Workspace