minorAxis: Adds an axis with minor ticks to a plot

View source: R/minorAxis.R

minorAxisR Documentation

Adds an axis with minor ticks to a plot

Description

Adds an axis with minor ticks to a plot, but with the possibility to have no superposition of minor ticks on major ticks, allowing to export a clean plot in vector format. It is based on the minor.tick function in the Hmisc package.

Usage

minorAxis(
  side,
  n = NULL,
  at.maj = NULL,
  at.min = NULL,
  range = NULL,
  tick.ratio = 0.5,
  labels.maj = TRUE,
  line = NA,
  pos = NA,
  outer = FALSE,
  font = NA,
  lty = "solid",
  lwd = 1,
  lwd.ticks = lwd,
  col = NULL,
  col.ticks = NULL,
  hadj = NA,
  padj = NA,
  extend = FALSE,
  tcl = NA,
  ...
)

Arguments

side

an integer (here 1,2,3 or 4) 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.

n

the number of intervals defined by the minor ticks

at.maj

the positions at which major tick-marks are to be drawn. By default (when NULL) tickmark locations are computed, see the "Details" part in the ?axis help page.

at.min

the positions at which minor tick-marks are to be drawn. This parameter overrides n.

range

the range of the axis

tick.ratio

ratio of lengths of minor tick marks to major tick marks. The length of major tick marks is retrieved from par("tcl") unless specified otherwise.

labels.maj

this can either be a logical value specifying whether (numerical) annotations are to be made at the major tickmarks, or a character or expression vector of labels to be placed at the major tickpoints.

line, pos, outer, font, lty, lwd, lwd.ticks, col, col.ticks, hadj, padj, tcl, ...

see the ?axis function help page for the other parameters

extend

whether to add minor ticks even outside the major ticks (T) or not (F)

See Also

Set a plot environment with minorAxis: whiteSet, blackSet and greySet

The ticks repartition is computed using minorAxisTicks

Examples

plot.new()
plot.window(xlim = c(0,1), ylim = c(0,1))

minorAxis(1, n = 10, range = c(0.12,0.61))

minorAxis(3, n = 10, extend=FALSE)

StratigrapheR documentation built on July 9, 2023, 6:02 p.m.