addGrid: Grid Lines

View source: R/addGrid.R

addGridR Documentation

Grid Lines

Description

Adds grid lines to a graph.

Usage

addGrid(current, Xgrid = list(grid = "gray50", finegrid = "none"),
  Ygrid = list(grid = "gray50", finegrid = "none"))

Arguments

current

the current plot information. Typically, this would be the output from one of the graph creation functions like xyPlot. See Details.

Xgrid

parameters defining the characteristics of the x-axis grid lines. The components refer to the color to draw the grid (at ticks) or finegrid (between ticks).

Ygrid

parameters defining the characteristics of the y-axis grid lines. The components refer to the color to draw the grid (at ticks) or finerid (between ticks).

Details

Information about grid lines is contained in the information returned from high-level plotting functions in the smwrGraphs package.

Value

NULL is returned invisibly.

Note

The function addGrid should be used after setting up a graph with one of the main plotting functions in the smwrGraphs package and setting the what component in the Plot argument to "none." The graph can be completed by using addXY.

See Also

xyPlot, timePlot, addXY

Examples

## Not run: 
set.seed(1)
X <- rnorm(32)
Y <- X + rnorm(32)
setGD()
AA.pl <- xyPlot(X, Y, Plot=list(what="none"))
# Grid first, then data to avoid over plotting
addGrid(AA.pl)
addXY(X, Y, Plot=list(what="points"))
# For more details of addGrid see
vignette(topic="GraphAdditions", package="smwrGraphs")

## End(Not run)

USGS-R/smwrGraphs documentation built on Oct. 11, 2022, 6:11 a.m.