title: How to drop connecting lines where the function is discontinuous
body: <p>I'm plotting some functions that have several discontinuities. Each function is given as a list. I want to connect points with lines only where the function is continuous.</p>
  
  <p>Here is a simplified example of what plot is doing.</p>
  
  <pre><code>x=linspace(0,1,100)    
  y=zeros(100)
  y[x&lt;0.5] = x[x&lt;0.5]
  y[x&gt;=0.5] = 1 + x[x&gt;=0.5]
  plot(x, y, '-o')
  </code></pre>
  
  <p>There is a discontinuity at x=0.5, but plot connects all points with lines regardless. </p>
  
  <p>My functions are different of course. They typically have several discontinuities in different places. The criterion for the discontinuity is simple. Say, if the function jumps by more than 0.5, I assume it is discontinuous at that point.</p>
  
  <p>Is there an option in plot to tell it to drop the connecting lines between the points where the function is discontinuous? I recall being able to do that easily with gnuplot.</p>