Mercurial > hg > octave-lyh
diff scripts/plot/private/__patch__.m @ 13308:9a83ec29aec9
Fix regression introduced by e9f6a6edec42.
* scripts/plot/private/__patch__.m: Fix regression for patch(x,y,z,"c"), and
patch(x,y,c) where the color is specified as a scalar for each vertex.
author | Ben Abbott <bpabbott@mac.com> |
---|---|
date | Mon, 10 Oct 2011 08:22:25 -0400 |
parents | e9f6a6edec42 |
children | 276bb0dd9d24 |
line wrap: on
line diff
--- a/scripts/plot/private/__patch__.m +++ b/scripts/plot/private/__patch__.m @@ -67,9 +67,15 @@ elseif (nargin > 3 && all (is_numeric_arg(1:3))) x = varargin{1}; y = varargin{2}; - z = []; - c = varargin{3}; iarg = 4; + if (rem (nargin - iarg, 2) == 1) + c = varargin {iarg}; + z = varargin{3}; + iarg = 5; + else + z = []; + c = varargin{3}; + endif elseif (nargin > 2 && all (is_numeric_arg(1:2))) x = varargin{1}; y = varargin{2}; @@ -134,17 +140,13 @@ args{8} = "interp"; args{9} = "cdata"; args{10} = []; + elseif (isequal (size (c), size (x)) && isequal (size (c), size (y))) + args{7} = "facecolor"; + args{8} = "interp"; + args{9} = "cdata"; + args{10} = c; else - if (rows (c) != rows (x) || rows (c) != length (y)) - error ("patch: size of x, y, and c must be equal"); - elseif (rows (c) == rows (x) && rows (c) == rows (y)) - args{7} = "facecolor"; - args{8} = "interp"; - args{9} = "cdata"; - args{10} = c; - else - error ("patch: color value not valid"); - endif + error ("patch: size of x, y, and c must be equal"); endif endif elseif (ischar (c) && rem (nargin - iarg, 2) == 0)