|
From: Thomas S. <t.s...@fz...> - 2007-09-05 09:08:24
|
set samples 100
plot int(t),binom(t,n,p) title 'Binomial' w lp, \
t,normal(t,mu,s2) title 'Normal'
you'll get 10 points plotted one over the other, which shouldn't
be a problem
- unless you use an old-style pen-plotter, this device may scratch
holes into the paper...
Allin Cottrell wrote:
>
> I can get the normal and the binomial superimposed via:
>
> comb(n,k) = n!/(k!*(n-k)!)
> binom(k,n,p) = comb(int(n),int(k))*p**k*(1-p)**(n-k)
> normal(x,mu,s2) = 1/(sqrt(2*pi*s2))*exp(-(x-mu)**2/(2*s2))
> set parametric
> p=0.5
> n=8
> mu=n*p
> s2=n*p*(1-p)
> set trange[0:n]
> set samples n+1
> plot t,binom(t,n,p) title 'Binomial' w lp, \
> t,normal(t,mu,s2) title 'Normal'
>
> Question: is there any way to get the normal curve to be smooth
> while the binomial one is properly discrete? It seems to me this
> implies conflicting settings for "samples", but maybe there's a
> clever trick?
>
> Allin Cottrell
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Splunk Inc.
> Still grepping through log files to find problems? Stop.
> Now Search log events and configuration files using AJAX and a browser.
> Download your FREE copy of Splunk now >> http://get.splunk.com/
> _______________________________________________
> Gnuplot-info mailing list
> Gnu...@li...
> https://lists.sourceforge.net/lists/listinfo/gnuplot-info
>
>
--
View this message in context: http://www.nabble.com/plotting-normal-plus-binomial-tf4380063.html#a12494384
Sent from the Gnuplot - User mailing list archive at Nabble.com.
|