MathGroup Archive 2007

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

Search the Archive

Re: Option for continuous plot

  • To: mathgroup at smc.vnet.net
  • Subject: [mg72929] Re: Option for continuous plot
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 25 Jan 2007 07:31:34 -0500 (EST)
  • References: <ep7ca5$bbd$1@smc.vnet.net>


Hi Virgil,

as you draw the lines yourselfe, you may simply connect the lines by:

Line[{{pp[[i]], i - 1}, {pp[[i + 1]], i - 1}, {pp[[i + 1]], i}}], {i, 1, 

n}]}]

However, would't it be easier to use ListPlot?

Daniel



Virgil Stokes wrote:

> I have defined the following two functions:

> 

> poissonProcess[λ_,n_] := FoldList[Plus,0,Table[-1/λ Log[1-Random[]],{n}]]

> 

> showPoissonProcess[λ_,n_,opts___] := With[{pp = poissonProcess[λ,n]},

> Show[Graphics[{AbsoluteThickness[1.5],Table[Line[{{pp[[i]],i-1},{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?

> 

> Thanks,

> V. Stokes

> 



  • Prev by Date: Error bars for 3D graphics?
  • Next by Date: Re: Option for continuous plot
  • Previous by thread: Re: Option for continuous plot
  • Next by thread: Re: Option for continuous plot