Index: scripts/plot/__bar__.m =================================================================== RCS file: /cvs/octave/scripts/plot/__bar__.m,v retrieving revision 1.10 diff -c -r1.10 __bar__.m *** scripts/plot/__bar__.m 9 Nov 2007 18:01:44 -0000 1.10 --- scripts/plot/__bar__.m 18 Nov 2007 14:48:13 -0000 *************** *** 107,115 **** width = width / ycols; endif ! cutoff = (x(1:end-1) + x(2:end)) / 2; ! delta_p = [(cutoff - x(1:end-1)); (x(end) - cutoff(end))] * width; ! delta_m = [(cutoff(1) - x(1)); (x(2:end) - cutoff)] * width; x1 = (x - delta_m)(:)'; x2 = (x + delta_p)(:)'; xb = repmat ([x1; x1; x2; x2](:), 1, ycols); --- 107,114 ---- width = width / ycols; endif ! cutoff = min (diff (x)) / 2; ! delta_p = delta_m = ones (size (x)) * cutoff * width; x1 = (x - delta_m)(:)'; x2 = (x + delta_p)(:)'; xb = repmat ([x1; x1; x2; x2](:), 1, ycols); *************** *** 137,175 **** xb = reshape (xb, [4, numel(xb) / 4 / ycols, ycols]); yb = reshape (yb, [4, numel(yb) / 4 / ycols, ycols]); ! color = [1, 0, 0; 0, 1, 0; 0, 0, 1; 1, 1, 0; 1, 0, 1; 0, 1, 1]; ! if (vertical) ! if (nargout < 2) ! newplot (); ! tmp = []; ! for i = 1 : ycols ! if (! have_line_spec) ! tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), color(i,:), newargs {:})]; ! else ! tmp = [tmp; patch(xb(:,:,i), yb(:,:,i), newargs {:})]; ! endif ! endfor ! if (nargout == 1) ! varargout{1} = tmp; ! endif ! else ! varargout{1} = xb; ! varargout{2} = yb; endif else ! if (nargout < 2) ! newplot (); ! tmp = []; ! for i = 1 : ycols ! if (! have_line_spec) ! tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), color(i,:), newargs {:})]; ! else ! tmp = [tmp; patch(yb(:,:,i), xb(:,:,i), newargs {:})]; ! endif ! endfor ! if (nargout == 1) ! varargout{1} = tmp; ! endif else varargout{1} = yb; varargout{2} = xb; --- 136,151 ---- xb = reshape (xb, [4, numel(xb) / 4 / ycols, ycols]); yb = reshape (yb, [4, numel(yb) / 4 / ycols, ycols]); ! if (nargout < 2) ! newplot (); ! tmp = __bars__ (vertical, x, y, xb, yb, have_line_spec, newargs {:}); ! if (nargout == 1) ! varargout{1} = tmp; endif else ! if (vertical) ! varargout{1} = xb; ! varargout{2} = yb; else varargout{1} = yb; varargout{2} = xb;