# HG changeset patch # User Andreas Weber # Date 1378888326 -7200 # Node ID a5de727e3795d31d68f194652c7496fe6c92ba27 # Parent 3611ebb0ad8881af1db5e0081086ceb9ed176efc __scatter__.m: Fix handling of NaNs in marker size param. diff -r 3611ebb0ad88 -r a5de727e3795 scripts/plot/private/__scatter__.m --- a/scripts/plot/private/__scatter__.m Tue Sep 10 22:00:19 2013 -0700 +++ b/scripts/plot/private/__scatter__.m Wed Sep 11 10:32:06 2013 +0200 @@ -30,29 +30,14 @@ y = varargin{5}(:); if (nd == 2) - idx = isnan (x) | isnan (y); - x(idx) = []; - y(idx) = []; - z = zeros (length (x), 0); istart = 6; else z = varargin{6}(:); - idx = isnan (x) | isnan (y) | isnan (z); - x(idx) = []; - y(idx) = []; - z(idx) = []; istart = 7; endif - firstnonnumeric = find (! cellfun ("isnumeric", varargin(istart:nargin)), 1); - if (isempty (firstnonnumeric)) - firstnonnumeric = Inf; - else - firstnonnumeric += istart - 1; - endif - if (istart <= nargin) - s = varargin{istart}; + s = varargin{istart}(:); if (isempty (s) || ischar (s)) s = 6; endif @@ -63,6 +48,28 @@ s = 6; endif + ## Remove NaNs + idx = isnan (x) | isnan (y) | isnan (s); + if (nd == 3) + idx |= isnan (z); + z(idx) = []; + endif + x(idx) = []; + y(idx) = []; + if (nd == 2) + z = zeros (length (x), 0); + endif + if (numel (s) > 1) + s(idx) = []; + endif + + firstnonnumeric = find (! cellfun ("isnumeric", varargin(istart:nargin)), 1); + if (isempty (firstnonnumeric)) + firstnonnumeric = Inf; + else + firstnonnumeric += istart - 1; + endif + if (istart <= nargin && firstnonnumeric > istart) c = varargin{istart}; if (isvector (c) && columns (c) != 3)