Add an arrow pointing to a tip or node on the tree
This function adds an arrow or a set of arrows to a plotted tree.
add.arrow(tree=NULL, tip, ...)
tree |
an object of class |
tip |
label of tip or tip or node number; or vector of such values. If |
... |
optional arguments to control the shape and size of the arrow including: its length ( |
This function presently works for radial (type="fan"
) and right facing square phylograms (type=
"phylogram"
). Trees can be plotted using phytools function plotTree
, plotSimmap
, contMap
, densityMap
, and ape S3 method plot.phylo
.
Liam Revell liam.revell@umb.edu
Revell, L. J. (2012) phytools: An R package for phylogenetic comparative biology (and other things). Methods Ecol. Evol., 3, 217-223.
## show arrows with a black outline data(anoletree) plotTree(anoletree,type="fan",fsize=0.7,ftype="i") add.arrow(anoletree,tip=c("cuvieri","krugi", "pulchellus","poncensis","stratulus", "evermanni","cooki","cristatellus", "gundlachi","occultus"),lwd=5,arrl=1) add.arrow(anoletree,tip="cuvieri",col="green", lwd=3,arrl=1) add.arrow(anoletree,tip=c("krugi","pulchellus", "poncensis"),col="#E4D96F",lwd=3,arrl=1) add.arrow(anoletree,tip=c("stratulus","evermanni"), col="darkgreen",lwd=3,arrl=1) add.arrow(anoletree,tip=c("cooki","cristatellus", "gundlachi"),col="brown",lwd=3,arrl=1) add.arrow(anoletree,tip="occultus",col="darkgrey", lwd=3,arrl=1) legend(x="topleft",c("crown-giant","grass-bush","trunk-crown","trunk-ground", "twig"),pch=22,pt.bg=c("green","#E4D96F","darkgreen", "brown","darkgrey"),cex=0.9, pt.cex=2,title="PR ecomorphs",bty="n") par(mar=c(5.1,4.1,4.1,2.1)) ## reset margins to default
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.