geneplotter (version 1.50.0)

histStack: Stacked histogram

Description

Stacked histogram

Usage

histStack(x, breaks, breaksFun=paste, ylab="frequency", ...)

Arguments

x
A list of numeric vectors.
breaks
Histogram breaks, as in hist
breaksFun
Function, can be used to control the formatting of the bin labels. See example.
ylab
Label for the Y-axis on the plot
...
Further arguments that get passed to barplot

Value

on the active graphics device. It returns the result of the call to barplot.

Details

The function calls hist for each element of x and plots the frequencies as a stacked barplot using barplot with beside=FALSE.

Examples

Run this code
  x    <- list(rnorm(42), rnorm(42)+2)
  br   <- seq(-3, 5, length=13)
  cols <- c("#1D267B", "#ceffc0")
  histStack(x, breaks=br, col=cols)

  histStack(x, breaks=br, col=cols,
            breaksFun=function(z) paste(signif(z, 3)))

Run the code above in your browser using DataLab