title: Multi-row x-axis labels in ggplot line chart
body: <p><strong>Edit:</strong> This question has been marked as duplicated, but the responses <a href="https://stackoverflow.com/questions/18165863/ggplot2-labels-of-grouping-values-below-the-plot">here</a> have been tried and did not work because the case in question is a line chart, not a bar chart. Applying those methods produces a chart with 5 lines, 1 for each year - not useful. Did anyone who voted to mark as duplicate actually try those approaches on the sample dataset supplied with this question? If so please post as an answer.</p>
  
  <p><strong>Original Question:</strong></p>
  
  <p>There's a feature in Excel pivot charts which allows multilevel categorical axes.I'm trying to find a way to do the same thing with <code>ggplot</code> (or any other plotting package in R).</p>
  
  <p>Consider the following dataset:</p>
  
  <pre><code>set.seed(1)
  df=data.frame(year=rep(2009:2013,each=4),
                quarter=rep(c("Q1","Q2","Q3","Q4"),5),
                sales=40:59+rnorm(20,sd=5))
  </code></pre>
  
  <p>If this is imported to an Excel pivot table, it is straightforward to create the following chart:</p>
  
  <p><img src="https://i.stack.imgur.com/XBDhQ.png" alt=""></p>
  
  <p>Note how the x-axis has two levels, one for quarter and one for the grouping variable, year. Are multilevel axes possible with <code>ggplot</code>?</p>
  
  <p>NB: There is a hack with facets that produces something similar, but this is not what I'm looking for.</p>
  
  <pre><code>library(ggplot2)
  ggplot(df) +
    geom_line(aes(x=quarter,y=sales,group=year))+
    facet_grid(.~year,scales="free")
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/s4yXK.png" alt=""></p>