shaded.range: Base plotting helper function to draw a shaded polygon

View source: R/shaded.range.R

shaded.rangeR Documentation

Base plotting helper function to draw a shaded polygon

Description

Base plotting helper function to draw a shaded polygon

Usage

shaded.range(x, y.L, y.U, bg, col = bg, lty = 3, col.adj = 0.25, lwd = 1)

Arguments

x

x-value

y.L

lower y-value

y.U

upper y-value

bg

background shading

col

line color

lty

line type

col.adj

factor modifying the opacity alpha. See alpha.f in adjustcolor()

lwd

lines width around polygon

Value

draws polygon based on x, y (upper and lower) values

Note

see polygon() function

Examples

set.seed(456)
y.val=rnorm(100)
x.val=y.val*rnorm(100)
mod=lm(y.val~x.val)
x.pred=seq(min(x.val),max(x.val),max(x.val)/10)
mod.pred=predict(mod, newdata=data.frame(x.val=x.pred),interval="confidence")

plot(y.val~x.val,type="n")
shaded.range(x.pred,mod.pred[,2],mod.pred[,3],"grey")
points(x.val,y.val,pch=19)

SwampThingPaul/AnalystHelper documentation built on Nov. 3, 2024, 10:02 a.m.