title: Ggplot2 facets: put y-axis of the right hand side panel on the right side
body: <p>I'm trying to make a facetted plot with two panels - left and right. The variable on the x-axis is continuous, and the variable on the y-axis is discrete, with relatively long labels. I would like to put the y-axis of the right hand side plot on the right side (and keep the y-axis of the left hand side left), so that the two panels are not split apart by the y-axis labels of the right hand side plot.</p>
  
  <p>I've tried a couple of different workaround (e.g. <code>cowplot</code>) but I can't get anything that I would be satisfied with, because I also need a legend in my plot. </p>
  
  <p>This is what I want to do:
    <a href="https://i.stack.imgur.com/8i1Cq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8i1Cq.png" alt="enter image description here"></a></p>
  
  <p>Here's a reprex:</p>
  
  <pre><code>library(tidyverse)
  
  region &lt;- sample(words, 20)
  panel &lt;- rep(c(0, 1), each = 10)
  value &lt;- rnorm(20, 0, 1)
  
  df &lt;- tibble(region, panel, value)
  
  ggplot(df, aes(value, region)) +
    geom_point() +
    facet_wrap(~ panel, scales = 'free_y')
  </code></pre>
  
  <p>Thank you!</p>