title: ggplot2: changing colors of segments in geom_segment gantt chart?
body: <p>i'm trying to make a gantt chart in ggplot2. i'm having troubles changing the colors and spacing of each segment in a geom_segment()</p>
  
  <pre><code>&gt; head(g672)
  mobility    start  endtime
  1    active  0.00000  1.60157
  3    active  1.60157 59.65837
  5    active 59.65840 68.93415
  7  immobile 68.93420 69.03430
  9    active 69.03430 77.87629
  11 immobile 77.87620 80.27855
  </code></pre>
  
  <p>I'm using geom_segment() to generate the chart:</p>
  
  <pre><code>ggplot(g672, aes(colour=mobility)) + 
    geom_segment(aes(x=start, xend=endtime, y=mobility, yend=mobility), size=15) +
    xlab("Duration") +
    theme_classic()
  </code></pre>
  
  <p>Which generates this chart:</p>
  
  <p><img src="https://i.stack.imgur.com/lNVla.jpg" alt="enter image description here"></p>
  
  <p>I'd like to be able to do 2 things: 1) change the colors and 2) make the 2 bars appear closer to each other or even get both of them overlapping (these are mutually exclusive categories so if you're not doing one, you're doing the other).</p>
  
  <p>cheers and thanks for any advice</p>