Open seasmith opened 5 years ago
Gives stat_bkde2d() the same behavior as stat_density2d() -- normalizing the density to the max density per group when facetting. Similar to the nlevel computed stat.
stat_bkde2d()
stat_density2d()
nlevel
library(ggplot2) library(ggalt) # from seasmith/ggalt branch add-ndensity ggplot(iris, aes(Sepal.Length, Petal.Length)) + stat_bkde2d(aes(fill = stat(density)), geom = "raster", contour = FALSE) + facet_wrap(vars(Species))
ggplot(iris, aes(Sepal.Length, Petal.Length)) + stat_bkde2d(aes(fill = stat(ndensity)), geom = "raster", contour = FALSE) + facet_wrap(vars(Species))
Very welcome addition! Can you also add yourself to the DESCRIPTION?
Gives
stat_bkde2d()
the same behavior asstat_density2d()
-- normalizing the density to the max density per group when facetting. Similar to thenlevel
computed stat.Before (density)
After (ndensity)