|
From: Lutz M. <lut...@gm...> - 2009-11-01 17:07:59
|
On Sun, Nov 1, 2009 at 8:42 AM, Allin Cottrell <cot...@wf...> wrote: > I'd like to plot two probability distribution curves together (in > a 2D graph), one a continuous pdf (e.g. Gaussian) and the other > discrete (e.g. Poisson or binomial). > > I can get a nice plot of each, separately, by setting a high > "samples" value for the continuous distribution and an appropriate > low value, corresponding to the number of integer values in the x- > or t-range, for the discrete one. But in a 2D plot there's only > one "samples" setting available. Maybe you could downsample inside the evaluation of the discrete function, something like this: rnd(x)=int(x+0.5) f(x)=exp(-x) g(x)=f(rnd(x)) plot [0:5] f(x), g(x) Hope this helps, Lutz |