Draw an erp x axis

Share:

Description

This function plots an x axis for an erp waveform. Numbers and tick positions are determined according to three parameters: length.erp, startmsec and endmsec (the function calls msectopoints).

Usage

1
2
3
4
5
6
erp.xaxis(length.erp = NULL, startmsec=-200, endmsec = 1200, 
x.tick = seq(-200, 1200, 200), x.labels = x.tick, x.las=0,
draw.x.ticks = TRUE, x.pos = NA, x.outer = FALSE, x.font = NA, 
x.lty = "solid", x.lwd = 1,  x.lwd.ticks = 1, x.col = NULL,
x.col.ticks = NULL, x.hadj = NA,  x.padj = NA, x.tcl = -0.5,
x.tick.both= FALSE, x.cex = 1)

Arguments

length.erp

the length of the ERP vector the axis refers to.

startmsec

start time (in ms) of the ERP vector.

endmsec

end time (in ms) of the ERP vector.

x.tick

the position (in ms) of x ticks.

x.labels

the labels (usually a vector of numbers) to be plotted on the x axis.

x.las

the style of x axis labels.

draw.x.ticks

a logical value specifying whether x tickmarks and an axis line should be drawn.

x.pos

the position of x axis, in terms of y axis coordinates. Default is NA and the axis is drawn at the bottom of the plot.

x.outer

a logical value indicating whether the x axis should be drawn in the outer plot margin, rather than the standard plot margin.

x.font

font for text of x labels. Default is par("font").

x.lty

line type of both the x axis line and the x tick marks.

x.lwd

line width of the x axis line.

x.lwd.ticks

line width of the x tick marks.

x.col

colors of the x axis line and the x tick marks.

x.col.ticks

the color of the x tick marks (if specified, overrides x.col)

x.hadj

adjustment (see par("adj")) for all x labels parallel ("horizontal") to the reading direction. If this is not a finite value, the default is used (centering for strings parallel to the axis, alignment of the end nearest the axis otherwise).

x.padj

adjustment for each x tick label purpendicular to the reading direction. For labels parallel to the axes, padj = 0 means right or top alignment, and padj = 1 means left or bottom alignment. This can be a vector given a value for each string, and will be recycled as necessary.

x.tcl

The length of tick marks as a fraction of the height of a line of text. The default value is -0.5.

x.tick.both

Logical. Should the tick marks be drawn both above and below the x axis?

x.cex

The magnification to be used for the x labels.

Value

An erp x axis is drawn on an existing plot.

Note

This function is called internally by the erp function.

Author(s)

Giorgio Arcara

See Also

erp, erp.yaxis

Examples

1
2
3
4
5
plot(1, ylim=c(-5,5), xlim=c(0,200), frame.plot=FALSE, 
type="n", axes=FALSE, xlab="", ylab="")

erp.xaxis(200, startmsec=-200, endmsec=1500, 
x.pos=0, x.lwd=2)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.