grayplot {broman} | R Documentation |
Scatterplot with a gray background
Description
Like the plot function, but using a gray background just for the plot region.
Usage
grayplot(
x,
y = NULL,
...,
type = "p",
hlines = NULL,
hlines.col = "white",
hlines.lty = 1,
hlines.lwd = 1,
vlines = NULL,
vlines.col = "white",
vlines.lty = 1,
vlines.lwd = 1,
xat = NULL,
yat = NULL,
bgcolor = "gray90",
pch = 21,
bg = "lightblue",
col = "black",
v_over_h = FALSE
)
Arguments
x |
Coordinates of points in the plot |
y |
Coordinates of points in the plot (optional) |
... |
Optional graphics arguments |
type |
Plot type (points, lines, etc.) |
hlines |
Locations of horizontal grid lines; use |
hlines.col |
Colors of horizontal grid lines |
hlines.lty |
Line type of horizontal grid lines |
hlines.lwd |
Line width of horizontal grid lines |
vlines |
Locations of vertical grid lines; use |
vlines.col |
Colors of vertical grid lines |
vlines.lty |
Line type of vertical grid lines |
vlines.lwd |
Line width of vertical grid lines |
xat |
Locations for x-axis labels; |
yat |
Locations for y-axis labels; |
bgcolor |
Background color |
pch |
point type |
bg |
Background color in points |
col |
Color of outer circle in points |
v_over_h |
If |
Details
Calls plot()
with type="n"
, then graphics::rect()
to
get the background, and then graphics::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).
Value
None.
See Also
dotplot()
, timeplot()
, graphics::par()
, graphics::rect()
, graphics::points()
Examples
x <- rnorm(100)
y <- x+rnorm(100, 0, 0.7)
grayplot(x, y, col="slateblue", pch=16)
at <- seq(-3, 3)
grayplot(x, y, col="violetred", pch=16, hlines=at, vlines=at)
grayplot(x, col="Orchid", pch=16, bgcolor="gray80",
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))