# HG changeset patch # User Ben Abbott # Date 1318249345 14400 # Node ID 9a83ec29aec9997ab84e255ffbf91fcf9402f9bf # Parent cbdefe0ec5143034c9563a73a583ce9c86289713 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. diff --git a/scripts/plot/private/__patch__.m b/scripts/plot/private/__patch__.m --- 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)