## tidy quasi density estimate
library(ggplot2)
data(faithfuld, package="ggplot2")
t1 <- tidy_as_kde(faithfuld)
## probabilistic density contour levels
ggplot(t1, aes(x=eruptions, y=waiting)) +
geom_contour_filled_ks(colour=1, aes(fill=after_stat(contperc)))
## non-probabilistic contour levels in ggplot2::geom_contour_filled
ggplot(faithfuld, aes(x=eruptions, y=waiting, z=density)) +
geom_contour_filled(bins=4) +
colorspace::scale_fill_discrete_sequential(palette="Heat")
## geospatial quasi density estimate
## see example in ? st_intergrid
Run the code above in your browser using DataLab