Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.net!border3.nntp.dca.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!postnews.google.com!news4.google.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Ingo Thies Newsgroups: comp.graphics.apps.gnuplot Subject: Re: Gaussian function Date: Sat, 07 Jan 2012 10:44:48 +0100 Lines: 31 Message-ID: <9mqighFoaaU1@mid.individual.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Id7KUwlzMSjG4EFFKhb6KgGFMfgpv2/nTPjPAKtK4laC225HFS Cancel-Lock: sha1:WXA86gkVnuzsXx1ZIxu+lA9ZZpY= User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:9.0) Gecko/20111222 Thunderbird/9.0.1 In-Reply-To: Xref: x330-a1.tempe.blueboxinc.net comp.graphics.apps.gnuplot:829 Hi, > Would anyone know how to plot a Gaussian function (normal > distribution), please? I'm using the function below, > > normal(x, mu, sd) = (1/(sd*sqrt(2*pi)))*exp(-(x-mu)**2/(2*sd**2)) I guess that your question is already answered in this formula... > The plot I'd like to make has these parameters, > > plot normal(x,70,5) title "" > > I set the yrange from zero to one. The issue at hand is that the > function should have its maximum at 1 but it does not thus I suppose > it is wrong. However i can't figure it out where the error is. I suppose you mean "the function should have a maximum of 1 at mu=70". However, the formula (which seems to bee correct) will not have a maximum of 1 in general since the term 1/(sd*sqrt(2*pi)) scales the rest of the function and thus defines the maximum (which is 1 in case x=mu if this factor is omitted). For sd=1 the maximum is 1/sqrt(2pi) = 0.3989... However, the *integral* of the Gaussian from -infinity to +infinity should be exact 1 unless otherwise scaled. HTH, Ingo