diff scripts/plot/__bar__.m @ 8056:9a6f4713f765

Add area, bar, quiver and stair series graphics objects. Document them
author David Bateman <dbateman@free.fr>
date Tue, 26 Aug 2008 11:58:14 -0400
parents a2d9f325b65a
children 73d6b71788c0
line wrap: on
line diff
--- a/scripts/plot/__bar__.m
+++ b/scripts/plot/__bar__.m
@@ -110,18 +110,17 @@
   endif
 
   ycols = size (y, 2);
+  cutoff = min (diff (double(x))) / 2;
   if (group)
-    width = width / ycols;
+    delta_p = delta_m = repmat (cutoff * width / ycols, size (x));
+  else
+    delta_p = delta_m = repmat (cutoff * width, size (x));
   endif
-
-  cutoff = min (diff (double(x))) / 2;
-  delta_p = delta_m = repmat (cutoff * width, size (x));
   x1 = (x - delta_m)(:)';
   x2 = (x + delta_p)(:)';
   xb = repmat ([x1; x1; x2; x2](:), 1, ycols);
 
   if (group)
-    width = width / ycols;
     offset = ((delta_p + delta_m) * [-(ycols - 1) / 2 : (ycols - 1) / 2]);
     xb(1:4:4*ylen,:) += offset;
     xb(2:4:4*ylen,:) += offset;