phenogram {phytools} | R Documentation |
Function plots a traitgram (Evans et al. 2009), that is, a projection of the phylogenetic tree in a space defined by phenotype (on the y axis) and time (on the x). If a discrete character is mapped on the tree this will also be plotted.
phenogram(tree, x, fsize=1.0, ftype="reg", colors=NULL, axes=list(), add=FALSE, ...)
tree |
an object of class |
x |
a vector containing the states at the tips or the states at all the tips and the internal nodes of the tree. |
fsize |
relative font size for tip labels. |
ftype |
font type - options are |
colors |
colors for plotting the mapped character (if available) in |
axes |
list of axis dimensions. Items are |
add |
optional logical value indicating whether to add to an open plot. If |
... |
optional arguments including |
For spread.labels=TRUE
numerical optimization is performed to optimize the distribution of the labels vertically, where the solution depends on the vector spread.cost
containing the cost of overlap (first) and the cost of deviation from the vertical position of the tip. Note that because this is done via numerical optimization, plotting may hang briefly while the best solution is found (especially for large trees).
Plots a traitgram, optionally with a mapped discrete character.
Liam Revell liam.revell@umb.edu
Evans, M. E. K., Smith, S. A., Flynn, R. S., Donoghue, M. J. (2009) Climate, niche evolution, and diversification of the "bird-cage" evening primroses (Oenothera, sections Anogra and Kleinia). American Naturalist, 173, 225-240.
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
tree<-pbtree(n=20,scale=2) x<-fastBM(tree) phenogram(tree,x) # or, simulate a discrete character history tree<-sim.history(tree,Q=matrix(c(-1,1,1,-1),2,2),anc="1") # simulate in which the rate depends on the state x<-sim.rates(tree,c(1,10)) phenogram(tree,x) # now use spread.labels tree<-pbtree(n=40) x<-fastBM(tree) phenogram(tree,x,spread.labels=TRUE,spread.cost=c(1,0))