%% plot kriging map in a new window

%%  Kriging Software Package  version 1.0 beta,   October 29, 1998
%%  Copyright (c) 1998, property of Dezhang Chu and Woods Hole Oceanographic
%%  Institution.  All Rights Reserved.

figure

hxy=pcolor(xg_grd,yg_grd,Cg);shading interp;
axis([ xgmin xgmax ygmin ygmax])

hc1=colorbar('horiz');
set(hc1,'Tag','Colorbar1');
hold on
[sc, ind]=sort(real(Ig));
clr=max(floor(clr_max*(var-1e-10)/max(var)),0)+1;
cmap=colormap;
deg2km=111;		% conversion factor from Longitude/Latitude to km
n=length(x);
inc=max(1,round(n/1600));
hold on
if TrackLineCode == 3
 for i=1:inc:n
   plot(xs(i),ys(i),'.','color',cmap(clr(i),:),'markersize',markersize);
 end
elseif TrackLineCode == 2
  if n >= 100
    hxy=plot(xs,ys,'w','linewidth',2.5);
  else
    hxy=plot(xs,ys,'.w','markersize',markersize);
  end
end

[c,H]=contour(xg_grd,yg_grd,Cg,'k');
hh=clabel(c,H);
if Lat_long == 1
   ht=title('KRIGING MAP ');
   hx=xlabel('LONGITUDE');
   hy=ylabel('LATITUDE');
else
   ht=title('KRIGING MAP');
   hx=xlabel('X (km)');
   hy=ylabel('Y (km)');
end
set([ht hx hy],'fontweight','bold')
hold off

colormap(fcmap);