axisChrono: Axis for time-calibrated phylogenies

axisChronoR Documentation

Axis for time-calibrated phylogenies

Description

This function adds a time scale on the side of a phylogeny plot.

Usage

axisChrono(side = 1, unit = NULL, fact = 1, ...)

Arguments

side

A numeric value specifying the side where the axis is plotted: 1: below, 2: left, 3: above, 4: right.

unit

A character string used to provide information on time units; defaults to "Ma" (million years ago).

fact

A real number used to scale the axis.

...

Arguments passed on to graphics::axis

at

the points at which tick-marks are to be drawn. Non-finite (infinite, NaN or NA) values are omitted. By default (when NULL) tickmark locations are computed, see ‘Details’ below.

labels

this can either be a logical value specifying whether (numerical) annotations are to be made at the tickmarks, or a character or expression vector of labels to be placed at the tickpoints. (Other objects are coerced by as.graphicsAnnot.) If this is not logical, at should also be supplied and of the same length. If labels is of length zero after coercion, it has the same effect as supplying TRUE.

tick

a logical value specifying whether tickmarks and an axis line should be drawn.

line

the number of lines into the margin at which the axis line will be drawn, if not NA.

pos

the coordinate at which the axis line is to be drawn: if not NA this overrides the value of line.

outer

a logical value indicating whether the axis should be drawn in the outer plot margin, rather than the standard plot margin.

font

font for text. Defaults to par("font").

lty

line type for both the axis line and the tick marks.

lwd

line widths for the axis line and the tick marks. Zero or negative values will suppress the line or ticks.

lwd.ticks

line widths for the axis line and the tick marks. Zero or negative values will suppress the line or ticks.

col

colors for the axis line and the tick marks respectively. col = NULL means to use par("fg"), possibly specified inline, and col.ticks = NULL means to use whatever color col resolved to.

col.ticks

colors for the axis line and the tick marks respectively. col = NULL means to use par("fg"), possibly specified inline, and col.ticks = NULL means to use whatever color col resolved to.

hadj

adjustment (see par("adj")) for all labels parallel (‘horizontal’) to the reading direction. If this is not a finite value, the default is used (centring for strings parallel to the axis, justification of the end nearest the axis otherwise).

padj

adjustment for each tick label perpendicular to the reading direction. For labels parallel to the axes, padj = 0 means right or top alignment, and padj = 1 means left or bottom alignment. This can be a vector given a value for each string, and will be recycled as necessary.

If padj is not a finite value (the default), the value of par("las") determines the adjustment. For strings plotted perpendicular to the axis the default is to centre the string.

gap.axis

an optional (typically non-negative) numeric factor to be multiplied with the size of an ‘m’ to determine the minimal gap between labels that are drawn, see ‘Details’. The default, NA, corresponds to 1 for tick labels drawn parallel to the axis and 0.25 otherwise, i.e., the default is equivalent to

  perpendicular <- function(side, las) {
    is.x <- (side %% 2 == 1) # is horizontal x-axis
    ( is.x && (las %in% 2:3)) ||
    (!is.x && (las %in% 1:2))
  }
  gap.axis <- if(perpendicular(side, las)) 0.25 else 1

gap.axis may typically be relevant when at = .. tick-mark positions are specified explicitly.

Author(s)

Christoph Heibl


phylotastic/datelifeplot documentation built on July 14, 2022, 12:35 p.m.