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.
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,
...
)
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.
the number of intervals defined by the minor ticks
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.
the positions at which minor tick-marks are to be drawn. This parameter overrides n.
the range of the axis
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.
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.
see the ?axis function help page for the other parameters
whether to add minor ticks even outside the major ticks (T) or not (F)
Set a plot environment with minorAxis: whiteSet
,
blackSet
and greySet
The ticks repartition is computed using minorAxisTicks
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)
Run the code above in your browser using DataLab