View source: R/plotTree.wBars.R
plotTree.wBars | R Documentation |
Plots a phylogenetic tree with adjacent boxplot or barplot.
plotTree.wBars(tree, x, scale=NULL, width=NULL, type="phylogram",
method="plotTree", tip.labels=FALSE, col="grey", border=NULL,
...)
plotTree.barplot(tree, x, args.plotTree=list(), args.barplot=list(),
...)
plotTree.boxplot(tree, x, args.plotTree=list(), args.boxplot=list(),
...)
tree |
an object of class |
x |
a named vector or matrix of trait values. For |
scale |
scaling factor for the tip bars (relative to the total tree height). If left as |
width |
width of the tip bars. |
type |
plot type. Can be |
method |
plotting method to use. Can be |
tip.labels |
argument indicating whether or not tip labels should be plotted. Defaults to |
col |
colors of the plotted bars. Can be a single value or a vector with length equal to the number of tips in the tree. |
border |
single value specifying the color of the border for the plotted bars. Defaults to |
args.plotTree |
in |
args.barplot |
in |
args.boxplot |
in |
... |
optional arguments to be passed to |
plotTree.wbars
plots a phylogeny in phylogram or fan style with bars at the tips representing the values for a phenotypic trait.
plotTree.barplot
creates a split plot in which a right-facing phylogram is on the left, and a bar plot is shown on the right.
plotTree.boxplot
creates a split plot in which a right-facing phylogram is on the left, and a box plot is shown on the right.
Plots a tree with an associated bar plot for a continuously valued character at the tips.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2024) phytools 2.0: an updated R ecosystem for phylogenetic comparative methods (and other things). PeerJ, 12, e16505.
barplot
, dotTree
, plotSimmap
, plotTree
## load data from Mahler et al. (2010)
data(anoletree)
data(anole.data)
## extract overall body size (SVL)
svl<-setNames(anole.data$SVL,rownames(anole.data))
## plotTree.wBars
plotTree.wBars(anoletree,svl,type="fan",scal=0.5)
par(mar=c(5.1,4.1,4.1,2.1))
## plotTree.barplot
plotTree.barplot(anoletree,exp(svl),
args.plotTree=list(fsize=0.5),
args.barplot=list(xlab="SVL (mm)"))
## load vertebrate tree and data
data(vertebrate.tree)
data(vertebrate.data)
## plotTree.barplot
options(scipen=4) ## change sci-notation
par(cex.axis=0.8)
plotTree.barplot(vertebrate.tree,
setNames(vertebrate.data$Mass,
rownames(vertebrate.data)),
args.barplot=list(
log="x",
xlab="mass (kg)",
xlim=c(0.01,500000),
col=palette()[4]))
options(scipen=0)
## reset par to defaults
par(mfrow=c(1,1),mar=c(5.1,4.1,4.1,2.1),cex.axis=1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.