grayplot(x, y, ..., type = "p", hlines, hlines.col = "white",
hlines.lty = 1, hlines.lwd = 1, vlines, vlines.col = "white",
vlines.lty = 1, vlines.lwd = 1, xat, yat, bgcolor = "gray80",
v_over_h = FALSE)
hlines=NA
to prevent horizontal grid linesvlines=NA
to prevent vertical grid linesxat=NA
indicates no labelsyat=NA
indicates no labelsTRUE
, place vertical grid lines on top of
the horizontal ones.plot
with type="n"
, then
rect
to get the background, and then
points
.
Additional arguments you can include: mgp.x
and mgp.y
(like mgp
, for controlling parameters of axis labels, but
separate for x- and y-axis).plot
,
par
,
rect
,
points
set.seed(97536917)
x <- rnorm(100)
y <- x+rnorm(100, 0, 0.7)
grayplot(x, y, col="blue", pch=16)
at <- seq(-3, 3)
grayplot(x, y, col="blue", pch=16, hlines=at, vlines=at)
grayplot(x, col="violet", pch=16, bgcolor="gray90",
hlines=seq(-4, 4, by=0.5), hlines.lwd=c(3,1),
vlines=seq(0, 100, by=5), vlines.lwd=c(3,1,1,1))
Run the code above in your browser using DataLab