R – Four Way to deal with scatterplot with many points

First, and the most horrible one when you have so many points:

data = data.frame(x=rnorm(1e4), y=rnorm(1e4))

plot(data, pch=19)

Image

smoothScatter(data)

Image

library(hexbin)

plot(hexbin(data))

Image

library(ggplot2)
ggplot(data, aes(x=x,y=y)) + geom_point(alpha=I(1/3))

Image

 

Leave a comment