title: Add labels to geom_bar by fill location
body: <p>I have the following data:</p>
  
  <pre><code>set.seed(1)
  df &lt;- data.frame(type=c("A","B","D","A","C","D","B","C","D","E"),
                   count=as.integer(runif(10,100,200)),
                   sample=c(1,1,1,2,2,2,3,3,3,3),stringsAsFactors=F)
  df$type &lt;- factor(df$type,levels=unique(sort(df$type)))
  </code></pre>
  
  <p>which I plot using <code>geom_bar</code>:</p>
  
  <pre><code>require(ggplot2)
  ggplot(df,aes(x=sample,y=count,fill=type))+geom_bar(stat="identity",position="dodge")+theme(legend.position="none")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/BuTxh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BuTxh.png" alt="enter image description here"></a></p>
  
  <p>My question is how to add <code>df$type</code> as a label on top of each bar?</p>
  
  <p>Adding:</p>
  
  <pre><code>geom_text(aes(label=type,hjust=0),position=("dodge"))
  </code></pre>
  
  <p>obviously doesn't work</p>