]> git.donarmstrong.com Git - ape.git/blob - man/add.scale.bar.Rd
new compute.brtime() + minor change in dist.topo.R
[ape.git] / man / add.scale.bar.Rd
1 \name{add.scale.bar}
2 \alias{add.scale.bar}
3 \title{Add a Scale Bar to a Phylogeny Plot}
4 \usage{
5 add.scale.bar(x, y, length = NULL, ask = FALSE,
6               lwd = 1, lcol = "black", ...)
7 }
8 \arguments{
9   \item{x}{x location of the bar (can be left missing).}
10   \item{y}{y location of the bar (can be left missing).}
11   \item{length}{a numeric value giving the length of the scale bar. If
12     none is supplied, a value is calculated from the data.}
13   \item{ask}{a logical; if \code{TRUE} the user is asked to click where
14     to draw the bar. The default is \code{FALSE}.}
15   \item{lwd}{the width of the bar.}
16   \item{lcol}{the colour of the bar (use \code{col} for the colour of
17     the text).}
18   \item{\dots}{further arguments to be passed to \code{text}.}
19 }
20 \description{
21   This function adds a horizontal bar giving the scale of the branch
22   lengths to a plot of a phylogenetic tree on the current graphical
23   device.
24 }
25 \details{
26   By default, the bar is placed in a corner of the graph depending on
27   the direction of the tree. Otherwise both \code{x} and \code{y} must
28   be specified (if only one is given it is ignored).
29
30   The further arguments (\code{\dots}) are used to format the text. They
31   may be \code{font}, \code{cex}, \code{col}, and so on (see examples
32   below, and the help page on \code{\link[graphics]{text}}).
33
34   The function \code{\link[graphics]{locator}}  may be used to
35   determine the \code{x} and \code{y} arguments.
36 }
37 \author{Emmanuel Paradis}
38 \seealso{
39   \code{\link{plot.phylo}}, \code{\link{axisPhylo}},
40   \code{\link[graphics]{locator}}
41 }
42 \examples{
43 tr <- rtree(10)
44 layout(matrix(1:2, 2, 1))
45 plot(tr)
46 add.scale.bar()
47 plot(tr)
48 add.scale.bar(cex = 0.7, font = 2, col = "red")
49 layout(matrix(1))
50 }
51 \keyword{aplot}