comparison scripts/plot/private/__bar__.m @ 11202:1840a0ecf1fb

__bar__.m: Permit bar() to be called with scalar inputs.
author Ben Abbott <bpabbott@mac.com>
date Mon, 08 Nov 2010 08:59:52 +0800
parents 95c3e38098bf
children fd0a3ac60b0e
comparison
equal deleted inserted replaced
11201:6c8791cb35b1 11202:1840a0ecf1fb
112 if (any (x(2:end) < x(1:end-1))) 112 if (any (x(2:end) < x(1:end-1)))
113 error ("%s: x vector values must be in ascending order", func); 113 error ("%s: x vector values must be in ascending order", func);
114 endif 114 endif
115 115
116 ycols = size (y, 2); 116 ycols = size (y, 2);
117 cutoff = min (diff (double(x))) / 2; 117 if (numel (x) > 1)
118 cutoff = min (diff (double(x))) / 2;
119 else
120 cutoff = 1;
121 endif
118 if (group) 122 if (group)
119 delta_p = delta_m = repmat (cutoff * width / ycols, size (x)); 123 delta_p = delta_m = repmat (cutoff * width / ycols, size (x));
120 else 124 else
121 delta_p = delta_m = repmat (cutoff * width, size (x)); 125 delta_p = delta_m = repmat (cutoff * width, size (x));
122 endif 126 endif