On Sun, 1 Nov 2009, Lutz Maibaum wrote:
> On Sun, Nov 1, 2009 at 8:42 AM, Allin Cottrell <cottrell@...> 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 trange, 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,
Indeed, that's the solution. Thanks!
Allin Cottrell
