Mercurial > hg > octave-lojdl
changeset 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 | cbdefe0ec514 |
children | 1f075333d9e8 |
files | scripts/plot/private/__patch__.m |
diffstat | 1 files changed, 14 insertions(+), 12 deletions(-) [+] |
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)