View source: R/plot_ClaDS_phylo.R
plot_ClaDS_phylo | R Documentation |
Plot a phylogeny with branches colored according to branch-specific rate values
plot_ClaDS_phylo(phylo, rates, rates2 = NULL,
same.scale = TRUE, main = NULL, lwd = 2,
log = TRUE, show.tip.label = FALSE, ...)
phylo |
An object of class 'phylo'. |
rates |
A vector containing the branch-specific rates, in the same order as phylo$edges. |
rates2 |
An optional second vector containing the branch-specific rates, in the same order as phylo$edges. If NULL (the default), the tree is only plotted once with the rate values from rates. If not, the tree is plotted twice, with the rate values from rates in the left panel and those from rates2 in the right panel. |
same.scale |
A boolean specifying whether the values from rates and rates2 are plotted with the same colorscale. Default to TRUE. |
main |
A title for the plot. |
lwd |
Width of the tree branch lengths. Default to 2. |
log |
A boolean specifying whether the rates values are plotted on a log scale. Default to TRUE. |
show.tip.label |
A boolean specifying whether the labels of the phylogeny should be displayed. Default to FALSE. |
... |
Optional arguments for |
Plot the phylogeny with branches colored according to branch-specific rate values
O. Maliet
Maliet O., Hartig F. and Morlon H. 2019, A model with many small shifts for estimating species-specific diversificaton rates, Nature Ecology and Evolution, doi 10.1038/s41559-019-0908-0
sim_ClaDS
set.seed(1)
obj= sim_ClaDS( lambda_0=0.1,
mu_0=0.5,
sigma_lamb=0.7,
alpha_lamb=0.90,
condition="taxa",
taxa_stop = 20,
prune_extinct = TRUE)
tree = obj$tree
speciation_rates = obj$lamb[obj$rates]
extinction_rates = obj$mu[obj$rates]
oldpar <- par(no.readonly = TRUE)
par(mar=c(1,1,0,0))
plot_ClaDS_phylo(tree,speciation_rates)
plot_ClaDS_phylo(tree,speciation_rates, lwd = 4, log = FALSE)
par(oldpar) # restore the old par
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.