Skip to content
Prev 344286 / 398498 Next

Help with continuous color plot

You missed a few things when copying the example, try

ggplot(testdataset2, aes(y=factor(Var2),x=value)) +
  stat_density(aes(fill=..density..), position="identity", geom="tile") +
  scale_fill_gradientn(colours=brewer.pal(n=8, name="PuBuGn"))

needed to add tile geom, and factor the correct variable.
On Wed, Sep 24, 2014 at 2:14 PM, Federico Lasa <felasa at gmail.com> wrote: