Skip to content

Scatterplot Showing All Points

1 message · bogdan romocea

#
Another approach which I'm pleased with but was not suggested so far
is jitter + kde2d from MASS:

plot(jitter(x), jitter(y))
if (!exists("kde2d")) require(MASS)
kdesamp <- 20000  #depending on your RAM
forkde <- if (kdesamp < length(x)) sample(1:length(x), kdesamp,
replace=FALSE) else 1:length(x)
d <- kde2d(x[forkde], y[forkde])
contour(d, add=TRUE)