Learn R Programming

phytools (version 0.1-9)

phenogram: Plot phenogram (traitgram)

Description

Function plots a traitgram, 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.

Usage

phenogram(tree,x,fsize=1.0,ftype="reg",colors=NULL,axes=list())

Arguments

tree
an object of class "phylo", with or without a mapped discrete character.
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 "reg", "i" (italics), "b" (bold), or "bi" (bold-italics).
colors
colors for plotting the mapped character (if available) in tree.
axes
list of axis dimensions. Items are time and trait.

Value

  • plots a traitgram, optionally with a mapped discrete character.

Examples

Run this code
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)

Run the code above in your browser using DataLab