Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

minor.tick

Minor Tick Marks


Description

Adds minor tick marks to an existing plot. All minor tick marks that will fit on the axes will be drawn.

Usage

minor.tick(nx=2, ny=2, tick.ratio=0.5, x.args = list(), y.args = list())

Arguments

nx

number of intervals in which to divide the area between major tick marks on the X-axis. Set to 1 to suppress minor tick marks.

ny

same as nx but for the Y-axis.

tick.ratio

ratio of lengths of minor tick marks to major tick marks. The length of major tick marks is retrieved from par("tck").

x.args

additionl arguments (e.g. post, lwd) used by axis() function when rendering the X-axis.

y.args

same as x.args but for Y-axis.

Side Effects

plots

Author(s)

Frank Harrell
Department of Biostatistics
Vanderbilt University
fh@fharrell.com
Earl Bellinger
Max Planck Institute
earlbellinger@gmail.com
Viktor Horvath
Brandeis University
vhorvath@brandeis.edu

See Also

Examples

# Plot with default settings
plot(runif(20), runif(20))
minor.tick()

# Plot with arguments passed to axis()
plot(c(0,1), c(0,1), type = 'n', axes = FALSE, ann = FALSE)
# setting up a plot without axes and annotation
points(runif(20), runif(20))                       # plotting data
axis(1, pos = 0.5, lwd = 2)                        # showing X-axis at Y = 0.5 with formatting
axis(2, col = 2)                                   # formatted Y-axis
minor.tick( nx = 4, ny = 4, tick.ratio = 0.3,
            x.args = list(pos = 0.5, lwd = 2),     # X-minor tick format argumnets
            y.args = list(col = 2))                # Y-minor tick format arguments

Hmisc

Harrell Miscellaneous

v4.5-0
GPL (>= 2)
Authors
Frank E Harrell Jr <fh@fharrell.com>, with contributions from Charles Dupont and many others.
Initial release
2021-02-27

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.