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