title: Plotting multi-colored line in Matlab
body: <p>I would like to plot a vertical line (I'd prefer any orientation, but I'd be happy with just vertical right now) with two-color dashes, say red-blue-red-blue-...</p>
  
  <p>I know I could do it like this:</p>
  
  <pre><code>plot([1,1],[0,1],'r'),
  hold on,
  plot([1,1],[0,1],'--b')
  </code></pre>
  
  <p>However, since I need to be able to move the line, among others, it should only have a single handle. How could I do this?</p>
  
  <p><strong>EDIT</strong>
  Thank you for your answers. I guess I should indeed give some more information.</p>
  
  <p>I have some data that is classified into different parts. I want to be able to manually adjust the boundaries between classes. For this, I'm drawing vertical lines at the classification boundaries and use <a href="http://www.mathworks.com/matlabcentral/fileexchange/4179-draggable" rel="noreferrer">draggable</a> to allow moving the lines. </p>
  
  <p>For the boundary between the red and the blue class, I'd like to have a red/blue line. </p>
  
  <pre><code>plot(ones(10,1),linspace(0,1,10),'-bs','MarkerFaceColor','r','MarkerEdgeColor','none','linewidth',6)
  </code></pre>
  
  <p>is what I'm actually using at the moment. However, it's not so pretty (if I want equal spacing, it becomes a real pain, and I want to give both colors the same weight), and I would like to have the possibility to use three colors (and not with marker edge and face being different, because it makes my eyes bleed).</p>
  
  <p>Unfortunately, draggable does not allow me to use multiple handles, and grouping the lines with hggroup does not seem to create a draggable object.</p>
  
  <p><a href="http://www.mathworks.com/matlabcentral/fileexchange/14677-cline" rel="noreferrer">cline</a> looks like a promising approach, but rainbow colors won't work for my application. </p>