function h = color_mark(x, y, var, MarkerSize) 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% c:\kate\matlab_programs\graph\color_mark.m
%
%	Function to plot a circle marker at locations x vs y 
%   with its color indicating the value of the varible var.
%   The data must be in vector format.
%   Returns the handle, h, to the marks
%
%  EXAMPLE
%	h = color_mark(x, y, var) ; 
%	h = color_mark(lon, lat, sst) ; 
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Must have at least 2 datapoints
if max(size(x)) == 1 x = [x x] ; y = [y y] ; var = [var var] ; end
hold on ;

x = row_vect(x) ; 
y = row_vect(y) ; 
var = row_vect(var) ; 

X = [x;x]; Y = [y;y]; Z = [var;var];
h = mesh(X, Y, zeros(size(X)), Z);
view(2) ;

set(h, 'Marker', 's', 'MarkerSize', MarkerSize,'markerfacecolor','flat','LineStyle', 'none')
grid off ;
