changeset 18072:b4b5ee91561a

fill.m: replicate cdata to match size of data for Matlab compatibility (bug #40777). * fill.m: replicate cdata to match size of data for Matlab compatibility (bug #40777).
author Rik <rik@octave.org>
date Tue, 03 Dec 2013 20:39:07 -0800
parents d48ef9e24324
children 1e27079409bf
files scripts/plot/draw/fill.m
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/draw/fill.m	Tue Dec 03 16:35:04 2013 -0800
+++ b/scripts/plot/draw/fill.m	Tue Dec 03 20:39:07 2013 -0800
@@ -93,6 +93,13 @@
 
       for i = 1 : length (iargs)
         cdata = varargin{iargs(i) + 2};
+        ## For Matlab compatibility, replicate cdata to match size of data
+        if (iscolumn (cdata))
+          sz = size (varargin{iargs(i)});
+          if (all (sz > 1))
+            cdata = repmat (cdata, [1, sz(2)]);
+          endif
+        endif
 
         [htmp, fail] = __patch__ (hax, varargin{iargs(i)+(0:1)}, cdata,
                                        opts{:});