1

I'm trying to make a 2d density plot + contour of a distribution with more than a million points, where the high density is concentrated only in part of the distribution.
I was able to obtain contours by using

ggplot(df, aes(x=var1, y=var2)) + geom_density_2d() 

However, I get contours only for the high density points but not for the entire distribution, including the low-density area.

Any help would be much appreciated!

s__
  • 9,270
  • 3
  • 27
  • 45
Danielle
  • 11
  • 1
  • 3
    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 Aug 09 '21 at 07:24
  • Hi, I have a sample test with the two variables I'm working with and a contour plot I'm obtaining. I'm new of this community and I'm not sure how can I attach a file.. – Danielle Aug 09 '21 at 08:17
  • I cannot attach files. What I'm trying to achieve is to get the contours also for the lower density parts of the distribution, and not only the most dense ones. Thank you – Danielle Aug 09 '21 at 08:22

0 Answers0