library(ggplot2) # install.packages("ggpointdensity") library(ggpointdensity) df <- data.frame(x = rnorm(5000), y = rnorm(5000)) ggplot(df, aes(x=x, y=y)) + geom_pointdensity() + scale_color_viridis_c()