Remove the lowest level/bin of stat_density_2d?

369 Views Asked by At

I have a contour graph/heat map of hockey shot locations that I have plotted on an image of a rink, but there is too much noise. Particularly the lowest bin is completely unnecessary and ruins the image. Is there a way to get rid of just this bin? I would want it to look something like this:

enter image description here

Code and image:

ggplot(full_data, aes(x=xCordall, y=yCordall)) +
          background_image(img)+
          stat_density_2d_filled(aes(fill= ..level..),geom = 'polygon',alpha= 0.8)+
          scale_x_continuous(limits = c(-100, 100))+
          scale_y_continuous(limits = c(-42.5, 42.5))+
          guides(fill=F)+
          theme_void()

This is what my code is producing

0

There are 0 best solutions below