function markerColor( h, AUTO )
% markerColor( h, auto )
%   will make the markers of a plot fill in with their boundary colors
%   (unless the "auto" flag is supplied and not false, in which case
%    this undoes the effect, i.e. the centers of the markers turn white)
%
%   h can be a handle to a graphics object; if it isn't supplied,
%    or set to [], then will use the current axes
%
%   Stephen Becker, 9/12/08 srbecker@caltech.edu

if nargin < 1 || isempty(h)
    h = gca;        % use current axis by default
end
if nargin < 2 || isempty(AUTO)
    AUTO = false;
end

myList = findobj(h,'-property','markerfacecolor');

for obj = myList'
    if AUTO
        set(obj,'markerfacecolor','auto');
    else
        clr = get(obj,'color');
        set(obj,'markerfacecolor',clr);
    end
    
end