]> git.donarmstrong.com Git - ape.git/blob - man/add.scale.bar.Rd
3ae6e596e805520557dc2dd9725b5214f6c0a456
[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 = 0, y = 1, length = NULL, ...)
6 }
7 \arguments{
8   \item{x}{x location of the bar.}
9   \item{y}{y location of the bar.}
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{...}{further arguments to be passed to \code{text}.}
13 }
14 \description{
15   This function adds a horizontal bar giving the scale of the branch
16   lengths to a plot of a phylogenetic tree on the current graphical
17   device.
18 }
19 \details{
20   As from version 1.4 of ape, the options of this function have been
21   redefined, and have now default values. By default, the scale bar is
22   plotted on the left bottom corner of the plot.
23
24   The further arguments (\code{...}) are used to format the text. They
25   may be \code{font}, \code{cex}, \code{col}, and so on (see examples
26   below, and the help page on \code{\link[graphics]{text}}).
27
28   The function \code{\link[graphics]{locator}}  may be used to
29   determine the \code{x} and \code{y} arguments.
30 }
31 \author{Emmanuel Paradis \email{Emmanuel.Paradis@mpl.ird.fr}}
32 \seealso{
33   \code{\link{plot.phylo}}, \code{\link{axisPhylo}},
34   \code{\link[graphics]{locator}}
35 }
36 \examples{
37 tr <- rtree(10)
38 layout(matrix(1:2, 2, 1))
39 plot(tr)
40 add.scale.bar()
41 plot(tr)
42 add.scale.bar(cex = 0.7, font = 2, col = "red")
43 layout(matrix(1))
44 }
45 \keyword{aplot}