0

I would like a plot that looks like this:

enter image description here

Using ggplot. The one above was made from heatscatter in the LSD package.

I tried using this code:

p = ggplot(data = emr.ext.melt, aes(Date,NDVI))
p  + geom_point() +  stat_density2d(aes(fill=..level..), geom="polygon") +
    scale_fill_gradient(low="blue", high="green")+ scale_y_continuous(limits = c(-1, 1))

But, got this weird plot. I just want a scatter plot colored based on the density of points for that given day. I do not want to use hexplot either.

enter image description here Thank you for your help!

il_raffa
  • 5,057
  • 111
  • 31
  • 33

0 Answers0