ggpointdensity
ggpointdensity copied to clipboard
Map density to fill not colour
Would be very cool to be able to set pch=21 and then map the point fill to density. Perhaps this is obvious but not to me. I tried
ggplot(mtcars) + geom_pointdensity(shape = 21, aes(mpg, cyl, fill=stat(density)))
But I get
Error: Aesthetics must be valid computed stats. Problematic aesthetic(s): fill = stat(density).
Did you map your stat in the wrong layer?