add.scale.bar {ape} | R Documentation |
This function adds a horizontal bar giving the scale of the branch lengths to a plot of a phylogenetic tree on the current graphical device.
add.scale.bar(x, y, phy, bar = NULL)
x |
the x location of the legend. |
y |
the y location of the legend. |
phy |
an object of class "phylo" . |
bar |
a numeric value giving the length of the scale bar. If none is supplied (the default), a value is calculated from the data. |
This function can be used in two ways: either an object of class
"phylo"
is given and its branch lengths are used to determine
the length of the scale bar, or the argument bar
is specified
and this is used as the length of the bar. In the latter case, the
argument phy
may be omitted.
Since the coordinate system is not displayed when plotting a tree, it
may be useful to use the function locator
to
determine the x
and y
arguments.
Emmanuel Paradis paradis@isem.univ-montp2.fr