# HG changeset patch # User Jordi GutiƩrrez Hermoso # Date 1336597176 14400 # Node ID 545580e7ebfa2b187931fae550293fd93be67022 # Parent f2ed09ae8d3f4bab206a70ebaadbc877ce36e06b hist.m: Normalise by number of non-NaN entries diff --git a/scripts/plot/hist.m b/scripts/plot/hist.m --- a/scripts/plot/hist.m +++ b/scripts/plot/hist.m @@ -149,7 +149,7 @@ if (nargin > 2 && ! ischar (varargin{iarg})) ## Normalise the histogram. norm = varargin{iarg++}; - freq = freq / rows (y) * norm; + freq = freq / sum(! isnan (y)) * norm; endif if (nargout > 0)