Learn R Programming

itsadug (version 2.0)

emptyPlot: Utility function

Description

Generate an empty plot window.

Usage

emptyPlot(xlim, ylim, main = NULL, xlab = NULL, ylab = NULL, h0 = NULL,
  v0 = NULL, bty = "n", eegAxis = FALSE, ...)

Arguments

xlim
A one- or two-value vector indicating the range of the x-axis. If xlim is a number, then it is assumed that the other value is 0. Thus, xlim=3000 wil result in a x-axis ranging from 0 to 3000, and xlim=-3 will res
ylim
A one- or two-value vector indicating the range of the y-axis. (See xlim) for more information.
main
Title for the plot. Empty by default. Note: the title can be added later using title.
xlab
Label for x-axis. Empty by default. If no label is provided, use mtext for adding axis labels.
ylab
Label for y-axis. Empty by default. (See xlab.)
h0
A vector indicating where to add solid horizontal lines for reference. By default no values provided.
v0
A vector indicating where to add dotted vertical lines for reference. By default no values provided.
bty
A character string which determined the type of box which is drawn about plots. If bty is one of "o", "l", "7", "c", "u", or "]" the resulting box resembles the corresponding upper case letter. A value of "n" (the default) suppresses the box.
eegAxis
Logical: whether or not to reverse the y-axis, plotting the negative amplitudes upwards as traditionally is done in EEG research. If eeg.axes is TRUE, labels for x- and y-axis are provided, when not provided by the user. Default value is FALSE.
...
Other arguments for plotting, see par.

Value

  • An empty plot window.

See Also

Use title and mtext for drawing labels and titles; use lines and points for plotting the data; use legend for adding a legend. and acf_n_plots for inspection of individual time series.

Other Functions for plotting: addInterval, add_bars, alphaPalette, alpha, check_normaldist, color_contour, dotplot_error, drawArrows, errorBars, fadeRug, fill_area, getCoords, getFigCoords, getProps, gradientLegend, marginDensityPlot, plot_error, plot_image, plotsurface, rug_model

Examples

Run this code
data(simdat)
test <- simdat[simdat$Subject=='a10' & simdat$Trial==10,]

emptyPlot(range(test$Time), range(test$Y),
main='Data', ylab='Y', xlab='Time', 
h0=0, v0=c(0,1000,2000))
# Note that this is the same as:
emptyPlot(range(test$Time), range(test$Y))
title(main='Data', ylab='Y', xlab='Time')
abline(h=0)
abline(v=c(0,1000,2000), lty=3)

# To add data, use lines() and points()
lines(test$Time, test$Y)

Run the code above in your browser using DataLab