function plotpatch( lo, la, dat )

% function plotpatch( x, y, dat )
%
% plots colored squares centered at [x,y] with color scaled by
% the values of dat.
%
% useful for overlaying values from a ship track on top of a contour
% plot.

% dail
% march 98

dx = range(lo)/100;
dy = range(la)/100;

for l=1:length(dat)
 xvs = [ lo(l)-dx lo(l)+dx lo(l)+dx lo(l)-dx ];
 yvs = [ la(l)-dy la(l)-dy la(l)+dy la(l)+dy ];
 a = patch( xvs, yvs,'k', 'cdata',dat(l), 'facecolor','flat' );
end 
