title: ggplot2: Formatting Legend Categories
body: <p>I would like to be able to do something like this: <a href="https://stackoverflow.com/a/30036603">https://stackoverflow.com/a/30036603</a>, except with "legend.text" instead of "axis.text.x". Is this possible?</p>
  
  <p>It would be something like this, except it's not currently working (all <code>labs</code> are italicized):</p>
  
  <pre><code>data &lt;- data.frame(labs = c("Oranges", "Apples", "Cucumbers"), counts = c(5, 10, 12))
  
  ggplot(data = data) +
  geom_bar(aes(x = labs, y = counts,fill=labs), stat="identity") +
  theme(axis.text.x=element_text(face=ifelse(levels(data$labs)=="Cucumbers","plain","italic"))) +
    theme(legend.text=element_text(face=ifelse(levels(data$labs)=="Cucumbers","plain","italic")))
  </code></pre>