title: R - Two sets of labels on on axis in a bar plot
body: <p>I have a dataframe that looks like this:</p>
  
  <pre><code>ID    Group    Measure1    Measure 2
  001   A        59          559
  002   A        44          623 
  003   B        129         498
  004   C        99          504
  005   C        78          378
  </code></pre>
  
  <p>I want to produce a bar graph that has two sets of labels on the X-axis: one identifying each bar with its ID value, another labeling each bar by Group it belongs to. My data is set up so that members of the same group are adjacent in the dataframe.</p>
  
  <p>The obvious solution of color-coding the bars by Group is not applicable because I am already using color-coding to show Measure1 and Measure2 (and in some cases Measure3). If there is another way to show the Group information besides labels, I am interested to hear it but I think that two sets of labels at the bottom of my chart is probably the best solution. Here's one such plot with only one set of labels:</p>
  
  <p><img src="https://i.stack.imgur.com/CmbmW.jpg" alt="Graph"></p>
  
  <p>I would like to add the Group labels underneath the "Patient ID" labels.</p>
  
  <p>If I get desperate, I will use Photoshop or Paint to add the labels but I am hoping there is a way to add a second set of labels using R.</p>