title: How NOT to display value 0 in a stacked bar chart using ggplot2
body: <p>I've managed to create a stacked bar chart using ggplot2, but one of the data value is 0. Is there a way to show all other data values, except 0?</p>
  
  <pre><code>dat &lt;- data.frame(matrix(NA, ncol=3, nrow=21))
  names(dat) &lt;- c("Var1", "Var2", "Freq")
  
  dat$Var1 &lt;- c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5,6,6,6,7,7,7)
  dat$Var2 &lt;- rep(letters[1:7],3)
  dat$Freq &lt;- c(3,11,1,5,9,4,1,5,4,0,7,2,5,2,3,11,11,15,5,10,10)
  dat &lt;- ddply(dat, .(Var1), transform, pos = cumsum(Freq)-0.5*Freq) ## pos is to place data values at the mid point.
  
  
  ggplot(dat, aes(x=factor(Var1), y=Freq)) + 
      geom_bar(stat="identity", aes(fill = Var2)) + 
      geom_text(aes(label=Freq, y = pos), size=3)
  </code></pre>
  
  <p>Edit: reproducible data provided.</p>