distShade: Shade the area under an existing distribution curve from two...

Description Usage Arguments Details Examples

Description

distShade(xlo, xhi, xvec, yvec, ...)

Usage

1
distShade(xlo, xhi, xvec, yvec, ...)

Arguments

xlo

the lower x-axis value where the shading begins

xhi

the higher x-axis value where the shading ends

xvec

the name of the vector of x-axis values

yvec

the name of the vector of y-axis values

...

further arguments to be passed to the polygon function

Details

This function is essentially a wrapper for the polygon function allowing the polygon to be drawn below a curve from fewer values.

Examples

1
2
3
4
5
6
7
# beta distribution, 90% interval
X = 0:100/100
Y = dbeta(X, 6, 3)
plot(X, Y, type="l")
Draws = sample(X, prob=Y, size=10000, replace=TRUE)
Qz = quantile(Draws, c(0.05,0.95))
distShade(Qz[1], Qz[2], X, Y, col="pink")

helophilus/ColsTools documentation built on May 30, 2019, 4:03 p.m.