Learn R Programming

simsem (version 0.2-8)

overlapHist: Plot overlapping histograms

Description

Plot overlapping histograms

Usage

overlapHist(a, b, colors=c("red","blue","purple"), breaks=NULL, xlim=NULL, 
	ylim=NULL, main=NULL, xlab=NULL, swap=FALSE)

Arguments

a
Data for the first histogram
b
Data for the second histogram
colors
Colors for the first histogram, the second histogram, and the overlappling areas.
breaks
How many breaks users used in each histogram (should not be used)
xlim
The range of x-axis
ylim
The range of y-axis
main
The title of the figure
xlab
The labels of x-axis
swap
Specify TRUE to plot b first and then a. The default is FALSE to plot a first and then b.

Value

  • None. This function will plot only.

Examples

Run this code
# This function is not a public function.

# a <- rnorm(10000, 0, 1)
# b <- rnorm(10000, 1, 1.5)
# overlapHist(a, b, main="Example")

Run the code above in your browser using DataLab