changeset 14612:545580e7ebfa

hist.m: Normalise by number of non-NaN entries
author Jordi Gutiérrez Hermoso <jordigh@octave.org>
date Wed, 09 May 2012 16:59:36 -0400
parents f2ed09ae8d3f
children e7c8e31f8e5d
files scripts/plot/hist.m
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/scripts/plot/hist.m	Tue May 08 21:03:42 2012 -0700
+++ b/scripts/plot/hist.m	Wed May 09 16:59:36 2012 -0400
@@ -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)