title: ggplot change line color specified by x axis values
body: <p>Code to reproduce:</p>
  
  <pre><code>myDat &lt;- data.frame(Event = rep(c("Arrival", "Departure"), 3),
                  AtNode = c("StationA", "StationA", "Track", "Track", "StationB", "StationB"),
                  Lane = c("Lane1", "Lane1", "Lane2", "Lane2", "Lane1", "Lane1"),
                  atTime = c(10, 12, 18, 20, 34, 36),
                  Type = c("Station", "Station", "Track", "Track", "Station", "Station"),
                  Train = 1 )
  ggplot(data =myDat, aes(x = atTime, y=factor(AtNode, levels = unique(paste(myDat[order(myDat$atTime),"AtNode"]))), group = Train, colour = Lane ))+
    geom_point(data = myDat)+
    geom_path(data = myDat[which(!grepl(pattern = "Track", myDat$Type)),])
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/wUXVQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/wUXVQ.png" alt="enter image description here"></a></p>
  
  <p>Now i need to project the two green points (Y = "Track") on the orange line and color the line between the projected points the same color as the points.</p>
  
  <p>Expected result: (without the points (Y ="Track")</p>
  
  <p><a href="https://i.stack.imgur.com/FRSNL.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/FRSNL.jpg" alt="enter image description here"></a></p>
  
  <p>Thanks in advance for every hint or trick!</p>
  
  <p>Cheers</p>