diff 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
line wrap: on
line diff
--- a/scripts/plot/private/__bar__.m
+++ b/scripts/plot/private/__bar__.m
@@ -114,7 +114,11 @@
   endif
 
   ycols = size (y, 2);
-  cutoff = min (diff (double(x))) / 2;
+  if (numel (x) > 1)
+    cutoff = min (diff (double(x))) / 2;
+  else
+    cutoff = 1;
+  endif
   if (group)
     delta_p = delta_m = repmat (cutoff * width / ycols, size (x));
   else