Learn R Programming

phytools (version 0.2-40)

plotBranchbyTrait: Plot branch colors by a quantitative trait or value

Description

Function plots a tree with branches colored by the value for a quantitative trait or probability, by various methods. Unlike most other tree plotting functions in phytools, this function calls plot.phylo (not plotSimmap) internally.

Usage

plotBranchbyTrait(tree, x, mode=c("edges","tips","nodes"), palette="rainbow", 
	legend=TRUE, xlims=NULL, ...)

Arguments

tree
an object of class "phylo".
x
either a vector of states for the edges, tips, or nodes of the tree (for mode="edges", "tips", and "nodes", respectively).
mode
string indicating plotting mode. mode="edges", the default, requires that the mapping state of each edge in the tree should be provided. mode="tips" takes the tip values and estimates the state at each internal node. The mapped c
palette
color palette to translate character values to color. Options are presently "rainbow" (the default), "heat.colors", and "gray".
legend
can be a logical value (TRUE or FALSE) or a numeric value greater than 0. In the latter case the numeric value gives the length of the plotted legend, which also acts as a scale bar for the branch lengths of the tree.
xlims
range for the translation map between trait values and the color map. Should be inclusive of all the values in x.
...
other optional arguments to be passed to plot.phylo.

Value

  • plots a phylogeny.

Details

Note that the functin will prompt for the position of the legend. For some reason, the position is required before the prompting message!