smoothScatter
produces a smoothed color density
representation of the scatterplot, obtained through a kernel
density estimate. densCols
produces a vector containing
colors which encode the local densities at each point in a
scatterplot.
smoothScatter(x, y = NULL, nbin = 128, bandwidth, colramp = colorRampPalette(c("white", blues9)), nrpoints = 100, pch = ".", cex = 1, col = "black", transformation = function(x) x^.25, postPlotHook = box, xlab = NULL, ylab = NULL, xlim, ylim, xaxs = par("xaxs"), yaxs = par("yaxs"), ...)
x
and y
arguments provide the x and y
coordinates for the plot. Any reasonable way of defining the
coordinates is acceptable. See the function xy.coords
for details. If supplied separately, they must be of the same length.gridsize
in bkde2D()
.bandwidth
is subsequently passed to function
bkde2D
.n
as an argument and
returning n
colors.nrpoints
points from those areas of lowest
regional densities will be plotted. Adding points to the plot
allows for the identification of outliers. If all points are to be
plotted, choose nrpoints = Inf
.NULL
or a function which will be
called (with no arguments) after image
.image
.image
.smoothScatter
produces a smoothed version of a scatter plot.
Two dimensional (kernel density) smoothing is performed by
bkde2D
from package \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}KernSmoothKernSmooth.
See the examples for how to use this function together with
pairs
.
bkde2D
from package \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}KernSmoothKernSmooth;
densCols
which uses the same smoothing computations and
blues9
in package grDevices. scatter.smooth
adds a loess
regression smoother to a scatter plot.