Helper function for axis labels using base plotting

axis_fun(
  side,
  at,
  at2,
  labels,
  cex.axis = 1,
  line = -0.25,
  lwd = 1,
  maj.tcl = -0.6,
  min.tcl = -0.3,
  las = 1,
  axisLine = 0,
  ...
)

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

major points at which tick-marks are to be drawn. Non-finite (infinite, NaN or NA) values are omitted.

at2

minor point at which tick-marks are to be drawn. Non-finite (infinite, NaN or NA) values are omitted.

labels

major tick mark labels

cex.axis

size of major axis labels text (default = 1)

line

the number of lines into the margin at which the axis line will be drawn (default = -0.25)

lwd

line widths for the axis line and the tick marks

maj.tcl

length of major ticks

min.tcl

length of minor ticks

las

direction of text

axisLine

the number of lines into the margin at which the axis line will be drawn

Value

a function that provides major and minor ticks with labels

Note

see axis() function

Examples

plot(runif(25),ylim=c(0,1),xlim=c(0,1),xaxt="n",yaxt="n")
axis_fun(1,seq(0,1,0.5),seq(0,1,0.25),seq(0,1,0.5))
axis_fun(2,seq(0,1,0.5),seq(0,1,0.25),seq(0,1,0.5))