title: How to position strip labels in facet_wrap like in facet_grid
body: <p>I would like to remove the redundancy of strip labels when using <code>facet_wrap()</code> and faceting with two variables and both scales free.</p>
  
  <p>For example, this <code>facet_wrap</code> version of the following graph </p>
  
  <pre><code>library(ggplot2)
  dt &lt;- txhousing[txhousing$year %in% 2000:2002 &amp; txhousing$month %in% 1:3,]
  
  ggplot(dt, aes(median, sales)) +
    geom_point() +
    facet_wrap(c("year", "month"), 
               labeller = "label_both", 
               scales = "free")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/TXQ8v.png" rel="noreferrer"><img src="https://i.stack.imgur.com/TXQ8v.png" alt="facet_wrap_version"></a></p>
  
  <p>should have the looks of this <code>facet_grid</code> version of it, where the strip labels are at the top and right edge of the graph (could be bottom and left edge as well).</p>
  
  <pre><code>ggplot(dt, aes(median, sales)) +
    geom_point() +
    facet_grid(c("year", "month"), 
               labeller = "label_both", 
               scales = "free")
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/riLlG.png" rel="noreferrer"><img src="https://i.stack.imgur.com/riLlG.png" alt="enter image description here"></a></p>
  
  <p><strong>Unfortunately, using <code>facet_grid</code> is not an option because, as far as I understand, it doesn't allow scales to be "completely free"</strong> - see <a href="https://github.com/tidyverse/ggplot2/issues/1152" rel="noreferrer">here</a> or <a href="https://stackoverflow.com/questions/3685285/ggplot2-facet-grid-free-scales">here</a></p>
  
  <p>One attempt that I thought about would be to produce separate plots and then combine them:</p>
  
  <pre><code>library(cowplot)
  theme_set(theme_gray()) 
  
  p1 &lt;- ggplot(dt[dt$year == 2000,], aes(median, sales)) +
    geom_point() +
    facet_wrap("month", scales = "free") +
    labs(y = "2000") + 
    theme(axis.title.x = element_blank())
  
  p2 &lt;- ggplot(dt[dt$year == 2001,], aes(median, sales)) +
    geom_point() +
    facet_wrap("month", scales = "free") +
    labs(y = "2001") + 
    theme(strip.background = element_blank(),
          strip.text.x = element_blank(),
          axis.title.x = element_blank())
  
  p3 &lt;- ggplot(dt[dt$year == 2002,], aes(median, sales)) +
    geom_point() +
    facet_wrap("month", scales = "free") +
    labs(y = "2002") + 
    theme(strip.background = element_blank(),
          strip.text.x = element_blank())
  
  plot_grid(p1, p2, p3, nrow = 3)
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/mKlrK.png" rel="noreferrer"><img src="https://i.stack.imgur.com/mKlrK.png" alt="enter image description here"></a></p>
  
  <p><strong>I am ok with the above hackish attempt, but I wonder if there is something in <code>facet_wrap</code> that could allow the desired output.</strong> I feel that I miss something obvious about it and maybe my search for an answer didn't include the proper key words (I have the feeling that this question was addressed before).</p>