Index: /issm/trunk/src/m/model/plot/latlonoverlay.m
===================================================================
--- /issm/trunk/src/m/model/plot/latlonoverlay.m	(revision 6645)
+++ /issm/trunk/src/m/model/plot/latlonoverlay.m	(revision 6646)
@@ -57,8 +57,4 @@
 end
 
-%Find lat and lon that fit within the bounds of our image.
-if length(md.lat)~=md.numberofgrids,  error('model field ''lat'' is empty'); end
-if length(md.long)~=md.numberofgrids, error('model field ''lon'' is empty'); end
-
 %what are the x and y limits
 xlimits=getfieldvalue(options,'xlim',xlim);
@@ -83,6 +79,7 @@
 	l=line(x,y,'Color',color);
 
-	if numbering,
-		ind=round(9*length(x)/10);
+	if numbering
+		ind=length(x)-2*latgap;
+		if (ind<=0), continue; end
 		xcorner=x(ind);            ycorner=y(ind);
 		xcorner2=x(max(ind-10,1)); ycorner2=y(max(ind-10,1));
@@ -126,5 +123,6 @@
 
 	if numbering,
-		ind=round(9*length(x)/10);
+		ind=length(x)-2*longap;
+		if (ind<=0), continue; end
 		xcorner=x(ind);            ycorner=y(ind);
 		xcorner2=x(max(ind-10,1)); ycorner2=y(max(ind-10,1));
