# 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 --git a/scripts/ChangeLog b/scripts/ChangeLog --- a/scripts/ChangeLog +++ b/scripts/ChangeLog @@ -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 --git a/scripts/plot/private/__bar__.m b/scripts/plot/private/__bar__.m --- 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