xaxsd: Par args xaxs and yaxs option d

View source: R/sitarlib.R

xaxsdR Documentation

Par args xaxs and yaxs option d

Description

Implements par('xaxs') and par('yaxs') option 'd'.

Usage

xaxsd(usr = par()$usr[1:2])

yaxsd(usr = par()$usr[3:4])

Arguments

usr

a length-2 vector defining the length of the x-axis or y-axis.

Details

Implements par('xaxs') and par('yaxs') option 'd', i.e. uses previous axis scales in a new plot.

Value

By default returns xlim/ylim args to match current setting of par()$usr, i.e. previous plot scales. Specifying usr gives scales with the usr args at the extremes. If par('xlog') or par('ylog') are set the returned limits are antilogged (to base 10).

Author(s)

Tim Cole tim.cole@ucl.ac.uk

Examples


## generate and plot 100 data points
x <- rnorm(100)
y <- rnorm(100)
plot(x, y, pch=19)

## generate and plot 10 more
## constraining axis scales to be as before
x <- rnorm(10)
y <- rnorm(10)
plot(x, y, pch=19, xlim=xaxsd(), ylim=yaxsd())

## force axis extremes to be -3 and 3
plot(x, y, pch=19, xlim=xaxsd(c(-3,3)), ylim=yaxsd(c(-3,3)))


sitar documentation built on July 9, 2023, 6:51 p.m.