changeset 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 6c8791cb35b1
children d468f5c10955
files scripts/ChangeLog scripts/plot/private/__bar__.m
diffstat 2 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/ChangeLog	Mon Nov 08 08:45:46 2010 +0800
+++ b/scripts/ChangeLog	Mon Nov 08 08:59:52 2010 +0800
@@ -1,5 +1,6 @@
 2010-11-08  Ben Abbott <bpabbott@mac.com>
 
+	* plot/private/__bar__.m: Permit bar() to be called with scalar inputs.
 	* plot/__go_draw_axes__.m, plot/axis.m: Set proper tight axis limits
 	for log scale.
 
--- a/scripts/plot/private/__bar__.m	Mon Nov 08 08:45:46 2010 +0800
+++ b/scripts/plot/private/__bar__.m	Mon Nov 08 08:59:52 2010 +0800
@@ -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