# HG changeset patch # User Ben Abbott # Date 1289177992 -28800 # Node ID 1840a0ecf1fbf1c0ebd1a7f48df88928b148b35f # Parent 6c8791cb35b19482d51702153121165c76159e07 __bar__.m: Permit bar() to be called with scalar inputs. diff -r 6c8791cb35b1 -r 1840a0ecf1fb scripts/ChangeLog --- 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 + * 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. diff -r 6c8791cb35b1 -r 1840a0ecf1fb scripts/plot/private/__bar__.m --- 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