[ top | up ]

Histograms

Syntax

hist(x, breaks, freq=TRUE, col=NULL, border=par("fg"), ...)

Arguments

x a vector of values for which the histogram is desired.
breaks either a single number giving the approximate number of cells for the histogram or a vector giving the breakpoints between histogram cells.
freq a logical vector which indicates whether the histogram is to present a representation of frequencies (the default) or relative frequencies.
col a colour to be used to fill draw the bars. The default of NULL yields unfilled bars.
border the color of the border around the bars.
... graphical parameters can also be specified as arguments.

Description

hist computes and plots a histogram of the given data values. The histogram cells are intervals of the form [a,b), i.e. they include their left-hand endpoint, but not their right one.

Examples

data(islands) hist(islands) hist(islands, col="gray") hist(islands, col="gray", border="gray")