function statgrid
%
global minlat minlon maxlat maxlon
global sizelon sizelat colors isobaths
global mapfigure
%
%  Convert latitudes and longitudes in minutes -------
Ymax = round(maxlat)*60. + (maxlat-round(maxlat))*0.6;
Ymin = round(minlat)*60. + (minlat-round(minlat))*0.6;
Xmax = round(maxlon)*60. + (maxlon-round(maxlon))*0.6;
Xmin = round(minlon)*60. + (minlon-round(minlon))*0.6;
rows = (Ymax - Ymin)/sizelat;
cols = (Xmax - Xmin)/sizelon;
boxes = rows * cols;
%
if mapfigure ~= [],
   for k = 1:rows-1,
      xhor(1,k) = minlon;
      xhor(2,k) = maxlon;
      yhor(1,k) = minlat + k*sizelat/60.;
      yhor(2,k) = minlat + k*sizelat/60.;
   end
   for k = 1:cols-1,
      yver(1,k) = minlat;
      yver(2,k) = maxlat;
      xver(1,k) = minlon + k*sizelon/60.;
      xver(2,k) = minlon + k*sizelon/60.;
   end
   if mapfigure == [],
    basemap(colors,isobaths,'big');
   else
    figure(mapfigure);
   end
   hold on
   line(xhor,yhor,'LineStyle','--','Color','m','EraseMode','none');
   line(xver,yver,'LineStyle','--','Color','m','EraseMode','none');
   drawnow
end

