function llgrid(gridsize)
% changes the grid of the current figure window to a lat/lon grid
% with appropriate labels.
% For now the data is expected in decimal degrees and the gridsize
% argument is expected to be in minutes.

%figure out where to put the tick marks
% note that this only works in nw hemisphere for now
bounds=axis * 60.0;
lonstart=bounds(1)-(gridsize(1)+rem(bounds(1),gridsize(1)));
latstart=bounds(3)+(gridsize(2)-rem(bounds(3),gridsize(2)));
nx=fix(abs(lonstart-bounds(2))/gridsize(1));
ny=fix(abs(latstart-bounds(4))/gridsize(2));
xticks=(lonstart+gridsize(1)*[0:nx].*ones(1,nx+1));
yticks=(latstart+gridsize(2)*[0:ny].*ones(1,ny+1));

%now figure the lables(strings) to go with the ticks

lonDeg=fix(xticks/60);
lonMin=(xticks/60 - lonDeg)*60;
latDeg=fix(yticks/60);
latMin=(yticks/60 - latDeg)*60;

%create the x axis lables
xlbls=[];
for i=1:nx+1,
   if lonDeg(i)/abs(lonDeg(i)) < 0
	tmp=sprintf('%3d%s %2.0f''W',abs(lonDeg(i)),setstr(176),abs(lonMin(i)));
   else
	tmp=sprintf('%3d%s %2.0f''E',abs(lonDeg(i)),setstr(176),abs(lonMin(i)));
   end

   xlbls=[xlbls;tmp];
end

%create the y axis lables
ylbls=[];
for i=1:ny+1,
   if latDeg(i)/abs(latDeg(i)) < 0
	tmp=sprintf('%3d%s %2.0f''S',abs(latDeg(i)),setstr(176),abs(latMin(i)));
   else
	tmp=sprintf('%3d%s %2.0f''N',abs(latDeg(i)),setstr(176),abs(latMin(i)));
   end

   ylbls=[ylbls;tmp];
end

%now make the changes to the plot
set(gca,'Tickdir','out');
set(gca,'YTICK',yticks./60);
set(gca,'XTICK',xticks./60);
set(gca,'YTickLabel',ylbls);
set(gca,'XTickLabel',xlbls);
set(gca,'fontname','times');
set(gca,'fontsize',12);
