axis_title: Adds an axis title in the margin

Description Usage Examples

Description

A simple wrapper for mtext, making sure that the character size is adjusted to be identical to the character size used on the ordinary axes, and respecting the setting for mgp in par. This is especially handy when plotting multiple panels (via the use of par(mfrow=...)), because axis labels are automatically adjusted in that case (see entry for mfrow in par).

Usage

1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Plot a second axis
set.seed(1)
x <- rnorm(100)
y <- x + rnorm(100)
z <- rnorm(100) - x

o <- par(mar=c(5,5,2,5)) 
plot(x, y, ylab="X variable")
points(x, z, pch=19)
axis_title("Z variable", side = 4)
axis(4)
par(o)

RemkoDuursma/plover documentation built on May 9, 2019, 9:39 a.m.