Plotting: Low-Level Functions

DESCRIPTION:

Render grid lines in a plot.

USAGE:

grid.render(grids, x.scale=NULL, y.scale=NULL, col=par("col"),  
            lty=par("lty"), lwd=par("lwd")) 

REQUIRED ARGUMENTS:

grids
list specifying grid lines (see below).

OPTIONAL ARGUMENTS:

x.scale
the scale to use for the x-coordinates. Can be NULL if the x elements of grids are in what plot considers to be the user coordinates for the plot. If the coordinates are given as calendar times or in user coordinates which are piecewise-linear transformations of plot coordinates, then scale is a 2-element list where the first element is a monotonic sequence in user-coordinates giving the endpoints of the linear regions, and the second element is the plot coordinates of those points. Points which lie outside the scale region will be moved to the ends and a warning will generated.
y.scale
the scale to use for the y-coordinates, as in x.scale.
col
color of lines, as in par.
lty
line type of lines, as in par.
lwd
width of lines, as in par.

VALUE:

(invisibly) a list of the arguments.

SIDE EFFECTS:

Causes grid lines to be added to the current plot.

DETAILS:

The grids argument is a list or a list of lists with the following elements (at least one of x and y must be present). Note that if it is a named list of lists, default plotting parameters for each list will come from trellis.par.get(name) if not supplied in that list element; the default list element name is "minor.grid" if the list is not named, which means that trellis.par.get("minor.grid") supplies the defaults.

VALUE:

x
(optional) positions for the grid lines perpendicular to the x-axis.
y
(optional) positions for the grid lines perpendicular to the y-axis.
col
color of lines, as in par.
lty
line type of lines, as in par.
lwd
width of lines, as in par.

SEE ALSO:

EXAMPLES:

xtck <- 1:10 
ytck <- 5 * xtck 
plot(xtck, ytck) 
grid.render(grids = list(x = xtck, y = ytck))