# HG changeset patch # User Rik # Date 1390442624 28800 # Node ID d7c88126ac03fbc14c0e0087b716146624b1f68d # Parent 6165053c56b3271d0acc9b39ba0c5dc2dfd511cc fill.m: Don't replicate cdata matrix to x,y size when it is a string. * fill.m: Don't replicate cdata matrix to x,y size when it is a string. Add new demo using replication of cdata. diff -r 6165053c56b3 -r d7c88126ac03 scripts/plot/draw/fill.m --- a/scripts/plot/draw/fill.m Wed Jan 22 17:20:40 2014 -0800 +++ b/scripts/plot/draw/fill.m Wed Jan 22 18:03:44 2014 -0800 @@ -94,7 +94,7 @@ for i = 1 : length (iargs) cdata = varargin{iargs(i) + 2}; ## For Matlab compatibility, replicate cdata to match size of data - if (iscolumn (cdata)) + if (iscolumn (cdata) && ! ischar (cdata)) sz = size (varargin{iargs(i)}); if (all (sz > 1)) cdata = repmat (cdata, [1, sz(2)]); @@ -161,3 +161,15 @@ %! y2 = cos (t2); %! h = fill (x1,y1,'r', x2,y2,'g'); +%!demo +%! clf; +%! x = [0 0 +%! 1 0.5 +%! 1 0.5 +%! 0 0]; +%! y = [0 0 +%! 0 0 +%! 1 0.5 +%! 1 0.5]; +%! c = [1 2 3 4]'; +%! fill (x, y, c);