Function plots one or multiple stochastic character mapped trees.
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, nodes="intermediate", tips=NULL, maxY=NULL,
hold=TRUE, split.vertical=FALSE,
lend=2, asp=NA, outline=FALSE, plot=TRUE)
# S3 method for simmap
plot(x, ...)
# S3 method for multiSimmap
plot(x, ...)
a modified object of class "phylo" or "multiPhylo" containing a stochastic mapping or set of mappings (e.g., see read.simmap
& make.simmap
).
a vector with names translating the mapped states to colors - see Examples
.
relative font size for tip labels.
font type - options are "reg"
, "i"
(italics), "b"
(bold), or "bi"
(bold-italics).
line width for plotting.
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 FALSE
.
a logical value indicating whether or not node numbers should be plotted.
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].
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 for the tip labels in character widths.
plotting direction. Options are "rightwards"
(the default), "leftwards"
, "upwards"
or "downwards"
. For method="fan"
direction
is ignored.
plot type. Can be "phylogram"
, "fan"
, or "cladogram"
. Only a subset of options are presently available for type="fan"
.
logical value indicating whether or not to set the environment .PlotPhyloEnv
. Setting this to TRUE
(the default) will allow compatibility with ape labeling functions such as nodelabels
.
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.
x-limits for the plot.
y-limits for the plot.
node placement following Felsenstein (2004; pp. 574-576). Can be "intermediate"
, "centered"
, "weighted"
, or "inner"
. So far only works for type="phylogram"
.
labeled vector containing the vertical position of tips. Normally this will be 1:N
for N
tips in the tree.
maximum value of y to use before rotating a tree into fan configuration. This will only make a difference if different from Ntip(tree)
.
logical argument indicating whether or not to hold the output to the graphical device before plotting. Defaults to hold=TRUE
.
split the color of the vertically plotted edges by the state of the daughter edges. Only applies if the edge state changes exactly at a node.
line end style. See par
.
aspect ratio. See plot.window
.
logical value indicating whether or not to draw a black outline around the plotted edges of the tree.
logical value indicating whether or not to actually plot the tree. (See equivalent argument in plot.phylo
.)
for S3 plotting method, object of class "simmap"
or "multiSimmap"
.
for S3 plotting method, other arguments to be passed to plotSimmap
.
Plots a tree.
The underscore character "_"
is automatically swapped for a space in tip labels, as in plot.phylo
.
Bollback, J. P. (2006) Stochastic character mapping of discrete traits on phylogenies. BMC Bioinformatics, 7, 88.
Felsenstein, J. (2004) Inferring Phylogenies. Sinauer.
Huelsenbeck, J. P., R. Neilsen, and J. P. Bollback. (2003) Stochastic mapping of morphological characters. Systematic Biology, 52, 131-138.
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
# NOT RUN {
data(anoletree)
cols<-setNames(c("green","#E4D96F","darkgreen",
"brown","black","darkgrey"),
c("CG","GB","TC","TG","Tr","Tw"))
plot(anoletree,cols,fsize=0.5,ftype="i",outline=TRUE,
lwd=3,ylim=c(0,Ntip(anoletree)),
mar=c(0.1,0.1,1.1,0.1))
add.simmap.legend(colors=cols,prompt=FALSE,x=0,y=-0.5,
vertical=FALSE)
title(main="Caribbean ecomorphs of anoles",font.main=3,
line=0)
par(mar=c(5.1,4.1,4.1,2.1)) ## reset margins to default
# }
Run the code above in your browser using DataLab