plot.kde {ks} | R Documentation |
Kernel density estimate plot for bivariate data.
## S3 method for class 'kde': plot(x, display="slice", ...)
x |
an object of class kde i.e. output from
kde function |
display |
type of display |
... |
other graphics parameters - see details below |
There are three types of plotting displays available, controlled
by the display
parameter.
If display="slice"
then a slice/contour plot
is generated using contour
.
The default contours are at 25%, 50%, 75% or
cont=c(25,50,75)
. The user can also set the number of contour
level curves by changing the value set to ncont
. See examples below.
If display="persp"
then a perspective/wire-frame plot
is generated. The default z-axis limits zlim
are determined by
the range of the z values i.e. default from the usual persp
command.
If display="image"
then an image plot
is generated. The colors are the default from the usual
image
command.
Plot of kernel density estimate is sent to graphics window.
Bowman, A.W. & Azzalini, A. (1997) Applied Smoothing Techniques for Data Analysis. Clarendon Press. Oxford.
Simonoff, J. S., (1996) Smoothing Methods in Statistics. Springer-Verlag. New York.
data(unicef) H.scv <- Hscv(unicef) fhat <- kde(unicef, H.scv) layout(rbind(c(1,2), c(3,4))) plot(fhat, display="slice", cont=seq(10,90, by=20), cex=0.3) plot(fhat, display="slice", ncont=5, cex=0.3, drawlabels=FALSE) plot(fhat, display="persp") plot(fhat, display="image", col=rev(heat.colors(15))) layout(1)