From: W. Trevor King Date: Tue, 27 Mar 2012 16:25:15 +0000 (-0400) Subject: Fix gaussian normalization in vibration_analyze.plot (no need for binwidth). X-Git-Tag: 0.8~21 X-Git-Url: http://git.tremily.us/?p=calibcant.git;a=commitdiff_plain;h=49be27dc3694132cf366f25093d6ce13991826c4 Fix gaussian normalization in vibration_analyze.plot (no need for binwidth). --- 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)