title: Individually change x labels using expressions in ggplot2 boxplot with facet_grid in R
body: <p>I want to individually change the x labels of my ggplot2 boxplot when using a facet_grid. I made the following simple example:</p>
  
  <pre><code>library(ggplot2)
  
  data1 &lt;- InsectSprays
  data1$group &lt;- "group 1"
  data2 &lt;- InsectSprays
  data2$group &lt;- "group 2"
  
  plotData &lt;- rbind(data1, data2)
  
  ggplot(plotData, aes(x=spray, y=count, fill=spray))+
  guides(fill=FALSE) +
  facet_grid(. ~ group) +
  geom_boxplot()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/YcBKH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/YcBKH.png" alt="enter image description here"></a></p>
  
  <p>I want to change the labels on the x axis (A, B, C,...), but individually for the two groups. One way changing the labels would be, using:</p>
  
  <pre><code>scale_x_discrete(labels=c("label 1", "label 2", ...))
  </code></pre>
  
  <p>but this would change the labels in both groups to the same values. At the end I also need to be able to use expressions for the labels. Is there any way to achieve what I want?</p>
  
  <p>EDIT:</p>
  
  <p>There is a very simple way to solve my problem (thanks @Axeman). By using:</p>
  
  <pre><code>scale_x_discrete(labels=c('A' = expression(beta)))
  </code></pre>
  
  <p>I can change the labels. In my example this would change both groups, but for me it is possible to rename the labels to individual labels beforehand and than use this trick to use expressions for the labels.</p>