Skip to contents

Plot a histogram with either a normal distribution or density curve overlay.

Usage

Thist(x, overlay = "normal", col = "gray80", ...)

Arguments

x

A numeric vector.

overlay

Either "normal" (default) or "density" indicating whether a normal distribution or density curve should be plotted on top of the histogram.

col

Color of the histogram bars.

...

Other arguments to be passed to hist().

Examples

set.seed(42)
x <- rnorm(1000, mean=5, sd=2)
Thist(x)

Thist(x, overlay="density")

Thist(x^2)

Thist(x^2, overlay="density", breaks=50, col="lightblue2")