function gbbathy(minx,maxx,miny,maxy,minz,maxz)
%
% routine load bathymetry matrix (ascii output of surfer) and contour
%
% where the arguments are just the bounding box in lat & lon
%          (note: minx and maxx should be negative #'s)
%
%          but these arguments are optional
%
clg;
axis('off');
e=exist('gb');
if e==0;
 load /home2/ocn/jmanning/gbr/bathy/gb.mtl
 blon=gb(1:100,1);
 blat=gb(1:100:5000,2);
 bz=(-1)*reshape(gb(:,3),100,50)';
end;
%
if nargin==0;
minx=-70;
maxx=-66;
miny=40;
maxy=42;
end;
%
%
set(0,'defaulttextfontsize',20)
set(0,'defaulttexthorizontalalignment','left');
texth=text(.1,-.5,'Select Bathymetry and Colormap Options Below','Color','r');
%
%
% Add some buttons to figure one to allow user options
%
b50h=uicontrol('style','checkbox','string',' 50m','Position',[ 20 20 60 20]);
b60h=uicontrol('style','checkbox','string',' 60m','Position',[ 90 20 60 20]);
b100h=uicontrol('style','checkbox','string','100m','Position',[ 160 20 60 20]);
b200h=uicontrol('style','checkbox','string','200m','Position',[ 230 20 60 20]);
bcusth=uicontrol('style','checkbox','string','user defined','Position',[20 50 150 20]);
bshade=uicontrol('style','checkbox','string','shaded bathy','Position',[20 80 150 20]);
colm=uicontrol('style','checkbox','string','color plot','Position',[20 150 120 20]);
threed=uicontrol('style','checkbox','string','3-d ','Position',[200 150 100 20]);
shading interp;
gs=uimenu('label','shading type (default= interp)');
uimenu(gs,'label','flat   ','Callback','shading flat   ');
uimenu(gs,'label','faceted','Callback','shading faceted');
uimenu(gs,'label','interp ','Callback','shading interp ');
%
disp('')
disp(' ***************************************************')
disp('      You have time (about 15 seconds)  to')
disp(' ')
disp('     click  bathymetry (if desired) and color plot (if desired) ')
disp(' ')
disp('        otherwise, just wait. ')
disp(' ***************************************************')
pause(15);

set(b50h,'Visible','off');
set(b60h,'Visible','off');
set(b100h,'Visible','off');
set(b200h,'Visible','off');
set(bcusth,'Visible','off');
set(bshade,'Visible','off');
set(texth,'Visible','off');
set(colm,'Visible','off');
set(threed,'Visible','off');
set(gs,'visible','off');

val50=get(b50h,'Value');
val60=get(b60h,'value');
val100=get(b100h,'Value');
val200=get(b200h,'value');
valcust=get(bcusth,'Value');
valshade=get(bshade,'Value');
valcolm=get(colm,'Value');
val3d=get(threed,'Value');
%
% define colormap
%
if valcolm==1;
 colormap(cmap(2,32)/256);
else
 colormap(gray(16));
end;
%
 axis('equal');
 xlabel('longitude');
 ylabel('latitude');
%
% plot bathy if asked;
%
% shade bathymetry if asked for
%
 if valshade==1;
  axis('off');
  clegend3([30 100],'depth(m)',0);
  pcolor(blon,blat,bz);
  caxis([30 100]);
   hold on;
 end;
%
% draw contour lines if requested
%
if val50==1|val60==1|val100==1|val200==1|valcust==1&val3d~=1;
 if valcust==1;
  cint=input('Enter contour min:int:max');
 else
  cint=[val50*50;val60*60;val100*100;val200*200];
 end;
   clab1=contour(blon,blat,bz,cint);
  axis([minx maxx miny maxy]);
  clabel(clab1,'manual');
end;
%
%
 if val3d==1;
    hold off;
   surfl(blon,blat,bz);
   axis([minx maxx miny maxy minz maxz]);
 end;
