title: Creating a continuous 1d heatmap in R
body: <p>For lack of a better name, I want to create a continous 1-d heatmap in R, i.e. a 1-d version of <a href="https://stackoverflow.com/questions/11531059/creating-a-continuous-heat-map-in-r">this question</a></p>
  
  <p>Toy data to use:</p>
  
  <pre><code>df &lt;- data.frame(x=1:20,
    freq=c(8, 7, 5, 6, 10, 4, 2, 9, 3, 10, 1, 8, 4, 7, 2, 6, 7, 6, 9, 9))
  </code></pre>
  
  <p>I can create a crude gridded output using</p>
  
  <pre><code>ggplot(data=df, aes(x=x, y=1)) + geom_tile(aes(fill=freq))
  </code></pre>
  
  <p>but similar to the other question, I'd like to have a smooth colour transition instead. Unfortunately, I don't understand the 2-d answer well enough to adapt it to 1-d.</p>