powered by
Plot the distribution of a variable with a center region shaded. Annotate with the area of the shaded region.
ShadedDensityCenter( frame, xvar, boundaries, title, ..., linecolor = "darkgray", shading = "darkblue", annotate_area = TRUE )
data frame to get values from
name of the variable to be density plotted
vector of the min and max boundaries of the shaded region
title to place on plot
no unnamed argument, added to force named binding of later arguments.
color of density curve
color of shaded region and boundaries
if TRUE (default), report the area of the shaded region
ShadedDensity
set.seed(52523) d = data.frame(meas=rnorm(100)) boundaries = c(-1.5, 1.5) WVPlots::ShadedDensityCenter(d, "meas", boundaries, title="Example center-shaded density plot")
Run the code above in your browser using DataLab