Learn R Programming

precisePlacement (version 0.2.0)

repelAxisLabels: Distribute Axis Label Locations to Avoid Overlap.

Description

Distribute Axis Label Locations to Avoid Overlap.

Usage

repelAxisLabels(side, at, labels, ..., spacing = "", reduceCex = TRUE)

Value

List containing the fields "originalAt", "at", and "cex.axis". "originalAt" is the input parameter "at" that has been sorted, "at" is a vector of new axis locations, and "cex.axis" is the cex value used to fit the labels without overlap (only necessary if reduceCex is TRUE).

Arguments

side

Integer giving the side of the plot, as in graphics::axis.

at

The points at which the axis labels and tickmarks would ordinarily be plotted.

labels

Character vector of axis labels.

...

Other arguments passed to strheight and strwidth, for example font.

spacing

Character string giving any spacing desired between the adjacent labels. Defaults to an empty string.

reduceCex

Logical indicating whether axis labels should be shrunk in size if they don't all fit. Defaults to TRUE.

Author

Jasper Watson