title: Fill gradient color not working with geom_bar of ggplot2
body: <p>When I use scale_fill_gradient() with geom_bar() in ggplot2, only one default color is filled for all bar. But expecting GREEN to RED for low to high count.</p>
  
  <pre><code>theTable &lt;- within(data, Tag &lt;- factor(tag, levels=names(sort(table(tag), 
                                                          decreasing=FALSE))))
  histGraph=ggplot(theTable,aes(x=Tag))+
    coord_flip() +
    scale_fill_gradient(low = "green", high = "red")+
    geom_bar(width=0.7)
  </code></pre>
  
  <p>Output of above code, </p>
  
  <p><a href="https://i.stack.imgur.com/v19Y8.png" rel="noreferrer"><img src="https://i.stack.imgur.com/v19Y8.png" alt="Actual output"></a></p>
  
  <p>And data look like,</p>
  
  <pre><code>ID  Tag
  1   BibArticleDOI
  1   FirstPage
  1   LastPage
  2   BibArticleDOI
  2   JournalTitle
  3   BibArticleDOI
  3   FirstPage
  </code></pre>
  
  <p><strong>Edit:</strong> 
  As got suggestion from Roman, editing above code. </p>
  
  <pre><code>dataOfTag &lt;- as.data.frame(table(data$tag))
  dataOfTag$tag &lt;- factor(dataOfTag$Var1, levels = dataOfTag$Var1[order(dataOfTag$Freq)])
  
  histPlot=ggplot(dataOfTag,aes(x=tag, y = Freq, fill = Freq))+
    coord_flip() +
    scale_fill_gradient(low = "green", high = "red")+
    geom_bar(width=0.7, stat = "identity")
  histPlot
  </code></pre>