title: ggplot2 bar chart labels for one column for data grouped by multiple columns
body: <p>I have a bar chart with x axis labels grouped by 2 column values. In the plot I want to show one column (<code>method</code>) values as legend and mark the other (<code>variable</code>) as labels on the plot itself for an easy to read picture. However each label on graph is repeated due to the grouping by the other column. How can I have a single label for a unique value instead of repeating it.?</p>
  
  <p>Sample data and current output is below.</p>
  
  <pre><code>df &lt;- data.table(w = rep(1:3, each = 3), 
          value = c(1.83,1.83,1.94,1.78,.95,1.09,3.14,3.14,3.14),
          method = seq(letters[1:3]),
          variable = c("fit","fit","fit","lwr","lwr","lwr","upr","upr","upr"))
  ggplot(df,aes(x=w, y=value, color=factor(variable), fill=factor(method))) +
          geom_bar(stat="identity", position = "dodge") +
          geom_text(aes(label=paste(variable)), position = position_dodge(width =0.9),vjust=-.25) +
          theme_bw() +
          scale_y_log10(breaks=c(1,2,11,101,1001),labels=c(0,1,10,100,1000)) +
  #       facet_wrap(~ppm) +
          annotation_logticks(sides = "lr")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/9PY6b.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/9PY6b.png" alt="enter image description here"></a></p>