Learn R Programming

phytools (version 0.3-72.1)

plotSimmap: Plot stochastic character mapped tree

Description

Function plots one or multiple stochastic character mapped trees.

Usage

plotSimmap(tree, colors=NULL, fsize=1.0, ftype="reg", lwd=2, pts=FALSE, 
	node.numbers=FALSE, mar=NULL, add=FALSE, offset=NULL, direction="rightwards",
	type="phylogram", setEnv=TRUE, part=1.0, xlim=NULL, ylim=NULL)

Arguments

tree
a modified object of class "phylo" or "multiPhylo" containing a stochastic mapping or set of mappings (e.g., see read.simmap & make.simmap).
colors
a vector with names translating the mapped states to colors - see Examples.
fsize
relative font size for tip labels.
ftype
font type - options are "reg", "i" (italics), "b" (bold), or "bi" (bold-italics).
lwd
line width for plotting.
pts
logical value indicating whether or not to plot filled circles at each vertex of the tree, as well as at transition points between mapped states. Default is TRUE.
node.numbers
a logical value indicating whether or not node numbers should be plotted.
mar
vector containing the margins for the plot to be passed to par. If not specified, the default margins are [0.1,0.1,0.1,0.1].
add
a logical value indicating whether or not to add the plotted tree to the current plot (TRUE) or create a new plot (FALSE, the default).
offset
offset for the tip labels. Primarily to be used internally by densityMap.
direction
plotting direction. Options are "rightwards" (the default) and "leftwards". Note that for some reason that is not totally clear, node.numbers=TRUE does not work for direction="leftwards".
type
plot type. Can be "phylogram" or "fan". Only a subset of options are presently available for type="fan".
setEnv
logical value indicating whether or not to set the environment .PlotPhyloEnv. Setting this to TRUE will allow (so far, only for type="phylogram" compatibility with ape function
part
value between 0 and 1 for type="fan" indicating what fraction of the full circular tree to use as plotting area. For instance, part=0.5 will plot a half fan phylogeny. It also affects the axis scaling used.
xlim
x-limits for the plot.
ylim
y-limits for the plot.

Value

  • Plots a tree.

Details

The underscore character "_" is automatically swapped for a space in tip labels, as in plot.phylo.

References

Huelsenbeck, J. P., R. Neilsen, and J. P. Bollback. (2003) Stochastic mapping of morphological characters. Systematic Biology, 52, 131-138. Bollback, J. P. (2006) Stochastic character mapping of discrete traits on phylogenies. BMC Bioinformatics, 7, 88.

See Also

densityMap, make.simmap, read.simmap

Examples

Run this code
# simulate a mapped tree
Q<-matrix(c(-2,1,1,1,-2,1,1,1,-2),3,3)
rownames(Q)<-colnames(Q)<-letters[1:3]
tree<-sim.history(pbtree(n=100,scale=1),Q)
cols<-setNames(c("blue","red","green"),letters[1:3])
# plot the mapping
plotSimmap(tree,cols,ftype="i",fsize=0.7)

Run the code above in your browser using DataLab