shadeplot: Shade a section of a pdf

Description Usage Arguments

Description

Plot a pdf and shade a section of it.

Usage

1
2
3
shadePlot(func = dnorm, xlim = c(-3, 3), ylim = NULL, shadelim = c(0,
  1), col = "red", xlab = "x", ylab = expression(paste(f[X](x))),
  main = "", ...)

Arguments

func

The density function to be plotted (dnorm, dt, df)

xlim

The x-limits for the plotting region

ylim

The y-limits for the plotting region. If left as NULL then it will automatically use a reasonable ylimit for the upper bound by figuring out the highest point in your plotting region

shadelim

A vector containing the upper endpoint and the lower endpoint of the region you want to shade

col

The color of the shaded region

xlab

Label for the x-axis

ylab

Label for the y-axis

main

Title for the plot

...

Additional parameters to pass onto the density function. For instance if you wanted to plot a normal density with a mean of 5 and sd of 2 you would also pass in mean=5, sd=2 in the parameter list (assuming you used dnorm as your 'func').


Dasonk/Dmisc documentation built on May 6, 2019, 1:36 p.m.