title: ggplot Adding Tracking Colors Below X-Axis
body: <p>I'd like to add a line below the x-axis where its color is dependant on a factor that is not plotted.</p>
  
  <p>In this example, I'm creating a box plot and would like to add a line that indicates another variable. </p>
  
  <p>Using the cars data set as an example and then physically dawing in what I'm trying to do:</p>
  
  <pre><code>ggplot(mtcars, aes(factor(cyl), mpg, fill=factor(am))) + 
  geom_boxplot()
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/rJEzF.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rJEzF.png" alt="enter image description here"></a></p>
  
  <p>My thought was to create a bar, column, or geom_tile plot and then arrange it below the boxplot. This is how I would do it in base R. Is there a way to add in these kinds of color labels in ggplot2?</p>