MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Option for continuous plot

On 1/24/07 at 5:58 AM, vs at (Virgil Stokes) wrote:

>I have defined the following two functions:

>poissonProcess[λ_,n_] := FoldList[Plus,0,Table[-1/λ

>showPoissonProcess[λ_,n_,opts___] := With[{pp =
>[i+1]],i-1}}],{i,1,n}]}], Axes\[Rule]True,opts]];

>for plotting a Poisson process; i.e.,

>SeedRandom[1]; showPoissonProcess[4, 20, AspectRatio -> 0.3];

>does indeed plot this process. However, I would like to have an
>option that would allow for these horizontal lines to be connected;
>i.e., produce a continuous curve.

>Is there a easy way to do this?

Easy is always open to debate. But here is one way to accomplish 
what you want

f = Interpolation[Transpose[
     {Evaluate[poissonProcess[4, 20]], Range[0, 20]}],
    InterpolationOrder -> 0]


Plot[f[x], {x, 0, 6.7}, AspectRatio->.3];
To reply via email subtract one hundred and four

  • Prev by Date: Re: FourierTransform help
  • Next by Date: Re: Options for Histogram3D
  • Previous by thread: Re: Option for continuous plot
  • Next by thread: Re: Option for continuous plot