From 49be27dc3694132cf366f25093d6ce13991826c4 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 27 Mar 2012 12:25:15 -0400 Subject: [PATCH] Fix gaussian normalization in vibration_analyze.plot (no need for binwidth). --- calibcant/vibration_analyze.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/calibcant/vibration_analyze.py b/calibcant/vibration_analyze.py index 1b8fec2..312c04b 100644 --- a/calibcant/vibration_analyze.py +++ b/calibcant/vibration_analyze.py @@ -520,10 +520,9 @@ def plot(deflection=None, freq_axis=None, power=None, A=None, B=None, std = deflection.std() pi = _numpy.pi exp = _numpy.exp - gauss = _numpy.sqrt(2*pi)/std * exp(-0.5*((bins-mean)/std)**2) + gauss = exp(-0.5*((bins-mean)/std)**2) / (_numpy.sqrt(2*pi) * std) # Matplotlib's normed histogram uses bin heights of n/(len(x)*dbin) - dbin = bins[1]-bins[0] - hist_axes.plot(bins, gauss/dbin, 'r-') + hist_axes.plot(bins, gauss, 'r-') hist_axes.autoscale(tight=True) if power is not None: freq_axes.hold(True) -- 2.26.2