
zmin = min(R);
zmax = max(R);

colormap = jet(10);
[m,n] = size(colormap);
h = [];
for i=1:length(R)
  zin = R(i);
  z = (zin-zmin)/(zmax-zmin);
  r = interp1(linspace(0,1,m),colormap(:,1),z);
  g = interp1(linspace(0,1,m),colormap(:,2),z);
  b = interp1(linspace(0,1,m),colormap(:,3),z);
  color = [r g b];
  h1 = plot3(X(i),Y(i),R(i),'.','color',color,'markersize',10);
  h = [h; h1];
  hold on
end
