%assumes you're near the end in webmaster

  close all

  fig_xleft_in=.1;
  fig_ybot_in=.1;
  fig_width_in=1.3*(diff(lonrange)/degperinch);  %make it bigger than axes
  fig_height_in=1.3*(diff(latrange)/degperinch);
  fig_position=[fig_xleft_in fig_ybot_in fig_width_in fig_height_in];

  ax_width_in=(diff(lonrange)/degperinch);
  ax_height_in=(diff(latrange)/degperinch);
  ax_xleft_in=max(.4,.1*ax_width_in); %shift the axes right from bot left corner
  ax_ybot_in=max(.4,.1*ax_height_in); %shift the axes up from bot left corner
  ax_position=[ax_xleft_in ax_ybot_in ax_width_in ax_height_in];

  paper_xleft_in=0;
  paper_ybot_in=11-(2*ax_ybot_in+ax_height_in)-1;
  paper_width_in=8.5;  %diff(lonrange)/degperinch;
  paper_height_in=11; %diff(latrange)/degperinch;
  paperposition=[paper_xleft_in paper_ybot_in paper_width_in paper_height_in];
  
  %now use figure(2) to draw the accumulated sections in correct dpi
  figure(2);clf  
  set(gcf,'units','inches')
  set(gcf,'Position',[fig_xleft_in fig_ybot_in fig_width_in fig_height_in])
  set(gcf,'PaperUnits','inches')
  set(gcf,'paperposition',paperposition)
  set(gcf,'PaperPositionMode','manual')
  set(gcf,'PaperOrientation','portrait')

  f1;clf
  [c,h]=contour6(top_lon,top_lat,topog,[-4000 -2000 -1000]);
  axes1=gca;
  hold on
  [bs,es,levs]=clines(c);
  for linei=1:length(levs)  
    h=plot(c(1,bs(linei):es(linei)),c(2,bs(linei):es(linei)),'k');
    set(h,'color',[1 1 1]*abs(levs(linei))/5000)
  end

  plot(x,y,'k');grid on
  axis('equal')
  axis([lonrange latrange])
  lltick(gca,'x','lon','y','lat');

  if (exist('sect_info'))
    for sectjj=1:length(sect_info)
      sect_color=sect_colors(~(sect_colors==sect_color)); %i.e. switch colors
      iii=sect_info(sectjj).ii;
      h=plot(x(iii(1):iii(2)),y(iii(1):iii(2)),sect_color);lw(h,2)
      xytext=sect_info(sectjj).xytext;
      h=text(xytext(1),xytext(2),sect_info(sectjj).name);
      set(h,'color',sect_color);set(h,'fontsize',fontsize)
    end
  end

  xytext=NaN*ones(length(sect_info),2);
  for ii=1:length(xytext(:,1))
	xytext(ii,:)=sect_info(ii).xytext;
  end
  title(cruise_name);

  grid on
  orient portrait
  set(axes1,'parent',2)
  close(1)
  figure(2)
  set(gca,'Units','inches')
  set(gca,'Position',ax_position)
  set(gca,'xlim',lonrange,'ylim',latrange)
  set(gcf,'Position',fig_position)
  set(gcf,'PaperUnits','inches')
  set(gcf,'paperposition',paperposition)
  set(gcf,'PaperPositionMode','manual')
  set(gcf,'PaperOrientation','portrait')
 
  print -depsc 'nav.eps';
 
  %convert eps to another file type 
  if (strcmp(translator,'i'))
	iconvert('nav','eps', new_extension,	CONVERT_SWITCHES);
  else    %%%%%%%if (strcmp(translator,'g'))
	gsconvert('nav','eps', new_extension,	CONVERT_SWITCHES);
%   else
% 	error('chose incorrect translator: see webglobs');
  end

  %center of the box in points
  box_cx=...
	72*[paper_xleft_in + ax_xleft_in + (xytext(:,1)-lonrange(1))/degperinch];
  box_cy=...
	72*[paper_height_in - (...
		paper_ybot_in+ax_ybot_in + (xytext(:,2)-latrange(1))/degperinch)];
  round([box_cx box_cy]);

  save6 sectinfo ...
		sect_info fig_position ax_position paperposition box_cx box_cy ;

