densCols produces a vector containing colors which encode the
local densities at each point in a scatterplot.
densCols(x, y = NULL, nbin = 128, bandwidth, colramp = colorRampPalette(blues9[-(1:3)]))
blues9x and y arguments provide the x and y
coordinates of the points. 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.densCols returns a vector of length nrow(x) that
contains colors to be used in a subsequent scatterplot. Each color
represents the local density around the corresponding point.
densCols computes and returns the set of colors that will be
used in plotting, calling bkde2D(*,
bandwidth, gridsize = nbin, ..) from package \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}KernSmoothKernSmooth. blues9 is a set of 9 color shades of blue used as the default in
plotting.
bkde2D from package \href{https://CRAN.R-project.org/package=#1}{\pkg{#1}}KernSmoothKernSmooth;
further, smoothScatter() (package graphics) which
builds on the same computations as densCols.