set(0, 'defaulttextinterpreter','tex')

minrange = 5; %try to look in a big enough region
lonrange = max(data.lon) - min(data.lon);
if (lonrange >= minrange)
   lonlims = [min(data.lon) max(data.lon)] + lonrange*[-.1 .1];
else
   lonlims = [min(data.lon) max(data.lon)] + minrange*[-.5 .5];
end

latrange = max(data.lat) - min(data.lat);
if (latrange >= minrange)
   latlims = [min(data.lat) max(data.lat)] + latrange*[-.1 .1];
else
   latlims = [min(data.lat) max(data.lat)] + minrange*[-.5 .5];
end

%make sure it doesn't go over /- 90
latlims(1) = max(-90, latlims(1));
latlims(2) = min( 90, latlims(2));


topo_cmap = mk_cmap(length(topo_clev), 'topo');
topo_irange =  [1 length(topo_cmap(:,1))]; % indices into topo_cmap
colormap([topo_cmap])
m_proj('lambert', 'long' ,lonlims, 'lat', latlims);
m_elev('contour',topo_clev);
m_grid('box','fancy','tickdir','in');
navtimes = NaN*data.lon;
m_track(data.lon, data.lat, navtimes, 'color', 'k', 'linewidth', 2);


if (~exist('closei','var'))
   closei = [];
end
if (~exist('okosi','var'))
   okosi = [];
end


if (~isempty(closei))
   [hp,ht]=m_vec(mvec_scale,...
                 data.lon(closei),data.lat(closei),...
                 data.uabs_refl_sm(closei),...
                 data.vabs_refl_sm(closei),...
                 'shaftwidth',.01);
   set(hp,'facecolor','r')
   set(hp,'edgecolor','r')
end

if (~isempty(okosi))
   [hp,ht]=m_vec(mvec_scale,...
                 data.lon(okosi),data.lat(okosi),...
                 data.uabs_refl_sm(okosi),...
                 data.vabs_refl_sm(okosi),...
                 'shaftwidth',.001);
   set(hp,'facecolor',[0 .5 0])
   set(hp,'edgecolor',[0 .5 0])
end


h_dcb = dcolbar( topo_clev/1000, 'vert', 'Depth (km)');
h_dcbp = findobj(h_dcb,'Type','patch');
cf_index(h_dcbp, topo_clev/1000, topo_irange);
