plot.histde: Plot for histogram density estimate

View source: R/hist.R

plot.histdeR Documentation

Plot for histogram density estimate

Description

Plot for histogram density estimate for 1- and 2-dimensional data.

Usage

## S3 method for class 'histde'
plot(x, ...)

Arguments

x

object of class histde (output from histde)

...

other graphics parameters:

col

plotting colour for density estimate

col.fun

plotting colour function for levels

col.pt

plotting colour for data points

jitter

flag to jitter rug plot (1-d). Default is TRUE.

xlim,ylim

axes limits

xlab,ylab

axes labels

add

flag to add to current plot. Default is FALSE.

drawpoints

flag to draw data points on density estimate. Default is FALSE.

breaks

vector of break values of density estimate. Default is an nbreaks equilinear sequence over the data range.

nbreaks

number of breaks in breaks sequence

lty.rect,lwd.rect

line type/width for histogram box lines (2-d)

border

colour of histogram box lines (2-d)

col.rect

colour of histogram bars (1-d)

add.grid

flag to add histogram grid (2-d). Default is TRUE.

Details

For histde objects, the function headers for the different dimensional data are

  ## univariate
  plot(fhat, xlab, ylab="Density function", add=FALSE, drawpoints=FALSE,
     col.pt=4, jitter=FALSE, border=1, alpha=1, ...) 
  
  ## bivariate
  plot(fhat, breaks, nbreaks=11, xlab, ylab, zlab="Density function", cex=1, 
     pch=1, add=FALSE, drawpoints=FALSE, col, col.fun, alpha=1, col.pt=4,
     lty.rect=2, cex.text=1, border, lwd.rect=1, col.rect="transparent",
     add.grid=TRUE, ...)

The 1-d plot is a standard plot of a histogram generated by hist. If drawpoints=TRUE then a rug plot is added.

The 2-d plot is similar to the display="filled.contour" option from plot.kde with the default nbreaks=11 contour levels.

Value

Plots for 1-d and 2-d are sent to graphics window.

See Also

plot.kde

Examples

data(iris)

## univariate example
fhat <- histde(x=iris[,2])
plot(fhat, xlab="Sepal length")

## bivariate example
fhat <- histde(x=iris[,2:3])
plot(fhat, drawpoints=TRUE)
box()

ks documentation built on May 29, 2024, 3:28 a.m.