aaxis: Add a Scientific Axis to a Plot

Description Usage Arguments Details Author(s) See Also Examples

Description

Adds an axis to the current plot.

Usage

1
2
3
4
aaxis(side = 1, at = NULL, labels = TRUE, majticks = TRUE, 
      minticks = TRUE, nmaj = NULL, nmin = NULL, unlog = FALSE, 
      format = NULL, digits = NULL, las = NULL, mgp = NULL, 
      tcl = NULL, dexcl = 0.2, ...)

Arguments

side

an integer specifying which side of the plot the axis is to be drawn on. The axis is placed as follows: 1=below, 2=left, 3=above and 4=right

at

the points at which the major tick-marks are to be drawn

labels

should axis annotation be added

majticks

should major tick marks be included

minticks

should minor tick marks be included

nmaj

number of major tick marks

nmin

number of minor tick marks between major marks

unlog

unlog axis annotation when the data is logged (base 10)

format

format for axes labelling (see 'formatC')

digits

number of digits for axes labels

las,mgp,tcl

standard 'par' plotting parameters

dexcl

distance from major tick marks within which no minor tick labels should be plotted

...

additional arguments to be passed to 'axis'

Details

The mid-level function 'aaxis' (astro:axis) is a wrapper around the R function 'axis'. It provides significant additional features which trivially allow the creation of figures more suited for a scientific audience. Notably, 'aaxis' allows minor tick-marks and logged axes to be created with the minimum of effort.

Author(s)

Lee Kelvin <lee.kelvin@uibk.ac.at>

See Also

The astronomy package: astro.

Examples

1
2
3
4
5
par("mar"=c(5.1,4.1,2.1,4.1))
aplot(1:1000, log10(1:1000), unlog="y", type="l", format="p", side=1:3, col="red", lwd=2)
aaxis(4, nmaj=4, nmin=9)
mtext(bquote(paste(log[10]," y ")), side=4, line=2.5)
label("bottomright", txt="astro:axis (aaxis)", cex=2, lwd=0, bgcol=NULL)

taranu/astro documentation built on May 23, 2019, 7:36 a.m.