0

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

Marco Sandri
  • 23,289
  • 7
  • 54
  • 58
  • 1
    It's easier to help you if you include a simple [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input that can be used to test and verify possible solutions. – MrFlick Jul 06 '20 at 03:21
  • 1
    There is an argument `breaks`. You can set it with [`position`](https://ggplot2.tidyverse.org/reference/geom_density_2d.html). – Rui Barradas Jul 06 '20 at 03:29
  • Or you can try out `cut()` it's a function that helps create bins – Daniel_j_iii Jul 06 '20 at 03:39

0 Answers0