tax.arrows | R Documentation |
By giving taxon numbers of a phylogenetic tree and graphical parameters, the function plots the phylogeny (if not already plotted) and arrows next to taxa for graphical purposes.
tax.arrows(phy,tax,side="topleft",angle=45,length,offset,arrow.fun="arrows",arrow.pars)
phy |
A phylogenetic tree. |
tax |
A vector with the name or the number of the taxa (tips and/or nodes) for plotting the arrows next to. |
side |
A vector to specify the side for plotting the arrows. Can be one |
angle |
The angle of the arrow in degrees. Can be a value between 0 and 360, somewhat overriding the |
length |
The length of the arrow. Default is to one tenth of the x span, but the user may try several values since this length if then expressed using both x and y. |
offset |
The length of the distance between the taxon and the end of the arrow. Default is to one tenth of the length, but the user may try several values since this length if then expressed using both x and y. |
arrow.fun |
The function to be used to draw the arrows, keeping in mind that the system used is here by providing x0/x1/y0/y1 coordinates. Default to |
arrow.pars |
A list of arguments to be passed to the arrow function used. See [base::arrows] for the base function arguments; see [shape::Arrows] for the function from the |
require(ape)
set.seed(1)
phy<-rtree(20)
plot(phy)
tax<-c(2,7,32)
tax.arrows(phy,tax)
tax.arrows(phy,tax,angle=0)
tax.arrows(phy,tax,angle=90)
tax.arrows(phy,tax,angle=45,arrow.pars=list(length=0.1,angle=30))
require(shape)
tax.arrows(phy,tax,angle=45,arrow.pars=list(arr.length=0.5,arr.type="triangle"),arrow.fun="Arrows")
tax.arrows(phy,tax,angle=45,arrow.pars=list(arr.length=0.2,arr.type="triangle",arr.col="red"),arrow.fun="Arrows")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.