stripes: Background and grid color control.

View source: R/stripes.R

stripesR Documentation

Background and grid color control.

Description

Some users like background colors, and it may be helpful to have grid lines to read off e.g. probabilities from a Kaplan-Meier graph. Both things can be controlled with this function. However, it mainly serves plot.prodlim.

Usage

stripes(
  xlim,
  ylim,
  col = "white",
  lwd = 1,
  gridcol = "gray77",
  fill = "white",
  horizontal = NULL,
  vertical = NULL,
  border = "black",
  xpd = FALSE
)

Arguments

xlim

Limits for the horizontal x-dimension. Defaults to par("usr")[1:2].

ylim

Limits for the vertical y-dimension.

col

Colors use for the stripes. Can be a vector of colors which are then repeated appropriately.

lwd

Line width

gridcol

Color of grid lines

fill

Color to fill the background rectangle given by par("usr").

horizontal

Numerical values at which to show horizontal grid lines, and at which to change the color of the stripes.

vertical

Numerical values at which to show vertical grid lines.

border

If a fill color is provided, the color of the border around the background.

xpd

From help(par): A logical value or NA. If FALSE, all plotting is clipped to the plot region, if TRUE, all plotting is clipped to the figure region, and if NA, all plotting is clipped to the device region. See also clip.

Author(s)

Thomas Alexander Gerds <tag@biostat.ku.dk>

Examples



plot(0,0)
backGround(bg="beige",fg="red",vertical=0,horizontal=0)

plot(0,0)
stripes(col=c("yellow","green"),gridcol="red",xlim=c(-1,1),horizontal=seq(0,1,.1))
stripes(col=c("yellow","green"),gridcol="red",horizontal=seq(0,1,.1))


Publish documentation built on Jan. 18, 2023, 1:08 a.m.