% This function was written by Yamit Maymon on 2002. (David Tannor's group).
%
% The function gets 3 vectors, x, y, and z. It plots over x vector, the
% values of vector y, colored according to vector z.


function h= myplot2(x,y,z)
  
if (nargin ==2)
    z=y;
end

mat=hsv(64);
a=63/2/pi;
b=1;
z=mod(z,2*pi);       % for values between 0 to 2*pi.
new_z=z.*a+b;


for indx=1:length(x)-1
    line ([x(indx) x(indx+1)],[y(indx) y(indx+1)],'color', mat(round(new_z(indx)),:));
end

return;
    