changeset 18335:d7c88126ac03

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.
author Rik <rik@octave.org>
date Wed, 22 Jan 2014 18:03:44 -0800
parents 6165053c56b3
children 15487cae60a3
files scripts/plot/draw/fill.m
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);