rggplot2

Smoothing stat_density_2d_filled in R to make distribution normal


I have a stat_density_2d_filled that looks like this (image provided), and the code looks like:

stat_density_2d_filled(aes(fill = ..level..), bins = 5, contour_var = "ndensity")

enter image description here

How can I smooth these out so they are essentially circles layered on top of each other rather than the blobs they currently are

I've tried adjusting the number of bins and Ive tried various other ggplot density functions


Solution

  • geom_contour_filled() does it!