motmot (version 2.1.3)

plot.traitMedusa.model: Tree plotting for rates

Description

Plots trees with colours based on rates of trait evolution. Also provides simple coloured plotting for trait values using the ace function in the ape library.

Usage

# S3 method for traitMedusa.model
plot(x, y = NULL, ..., reconType = "rates", palette = "hotspot.colors")

Arguments

x

Output from summary.traitMedusa.

y

A matrix of trait values.

...

Other functions to pass to plot.phylo

reconType

Colour branches according to rate shifts ("rates" - requires traitMedusaObject) or ancestral state reconstruction ("picReconstruction" - requires x).

palette

Defines the colour scheme with four options: hotspot.colors (red to blue), heat.colors (yellow to red), cool.colors (blues), combi.colors (yellows to reds and blues)

Value

Returns a data frame of colours used in plot along with rate (or ancestral state) range for each colour.

See Also

transformPhylo.ML, summary.traitMedusa.

Examples

Run this code
# NOT RUN {
# Data and phylogeny
data(anolis.tree)
data(anolis.data)

# female SVL data
female.svl <- matrix(anolis.data[,"Female_SVL"], 
dimnames=list(rownames(anolis.data)))
input.data <- sortTraitData(phy=anolis.tree, y=female.svl, log.trait=TRUE)

# arbitarily reduce data size for speed in this example
phy.clade <- extract.clade(input.data[[1]], 182)
male.length.clade <- as.matrix(input.data[[2]][match(input.data[[1]]$tip.label, 
rownames(input.data[[2]])),])
# Identify rate shifts and print and plot results with up to one rate shifts 
# and minimum clade size of 10.
anolisSVL_MEDUSA <- transformPhylo.ML(male.length.clade, phy=phy.clade, 
model="tm1",minCladeSize=10, nSplits=1)
anolisSVL_MEDUSA_out <- summary(anolisSVL_MEDUSA, cutoff=1, AICc=FALSE)
colours <- plot(x = anolisSVL_MEDUSA_out,
reconType = "rates", type = "fan", cex=0.6, edge.width=3)
# }

Run the code above in your browser using DataLab