function pcr=fillc(lc) %FILLC Fill the image contours % % HPATCHES=FILLC(HLINES) % % Claudio 28 Oct 1995 % Copyright (c) 1995 by Claudio Rivetti and Mark Young % claudio@alice.uoregon.edu, mark@alice.uoregon.edu pc=[]; for i=length(lc):-1:1 if strcmp(get(lc(i), 'visible'), 'on')==1 X=[get(lc(i), 'Xdata') NaN]; Y=[get(lc(i), 'Ydata') NaN]; Z=[get(lc(i), 'Zdata') NaN]; c=get(lc(i), 'color'); n=find(isnan(X)==1); n=[0 n]; for j=1:length(n)-1 x=X(n(j)+1:n(j+1)-1); y=Y(n(j)+1:n(j+1)-1); z=Z(n(j)+1:n(j+1)-1); p=fill(x,y,c, 'EdgeColor', c); set(p, 'Zdata', z+i*100); pc=[pc;p]; end end end if nargout > 0 pcr=pc; end return