addMinorTicks: Add Axis Ticks

View source: R/addMinorTicks.R

addMinorTicksR Documentation

Add Axis Ticks

Description

Adds minor axis ticks to a graph.

Usage

addMinorTicks(which, current, ticks)

Arguments

which

which axis to label, must be one of "bottom," "left," "top," or "right," "x," or "y." If which is "x," then add both bottom and top minors ticks. If which is "y," then add both left and right minor ticks.

current

the current plot information, see Details.

ticks

the number of minor ticks to draw. If missing, then the default number is used, see Details.

Details

The current argument must contain a component named yax if which is "left" or "right" or a component named xax if which is "bottom" or "top." Those arguments are generally constructed from functions like linearPretty.

The default placement of minor ticks is at the largest unit that lies between the major ticks—if the difference between major ticks is an even multiple of 2 or 5, then the minor interval will be that even multiple of 1, otherwise it will be 1/10 that even multiple.

Value

The current plot information is returned invisibly.

Note

In general, this should be used only with linear axes. Other axis types can result in unexpected results.

See Also

linearPretty, addAxisLabels, addLabel

Examples

## Not run: 
set.seed(1)
X <- runif(25, .5, 9.5)
Y <- runif(25)
setGD()
AA.pl <- xyPlot(X, Y)
addMinorTicks("bottom", AA.pl)
addMinorTicks("top", AA.pl)
# For more details of addMinorTicks see
vignette(topic="DateAxisFormats", package="smwrGraphs")

## End(Not run)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.