MathGroup Archive 2001

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

Search the Archive

RE: plotting cadlag point process

  • To: mathgroup at smc.vnet.net
  • Subject: [mg30685] RE: [mg30661] plotting cadlag point process
  • From: "Wolf, Hartmut" <Hartmut.Wolf at t-systems.de>
  • Date: Sat, 8 Sep 2001 02:22:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com


> -----Original Message-----
> From: Martin Richter [mailto:mrMICE.fi at cbs.dk]
> Sent: Tuesday, September 04, 2001 2:33 AM
> Subject: [mg30661] plotting cadlag point process
> 
> 
> Hi
> 
> I need to make plots of cadlag point process, as a simple example,
> the homogenous Poisson process. I have a data file with jump times
> and sizes so it looks like this
> 
>                          .____
> 
>            .______o
> 
> 
> ______o
> 
> there the O is a open dot and . is a filled dot. So the data could
> look like this (of course not the Poisson process)
> 
>          0         0
>        1.9         2
>        2.1         5
>        3.2         3
> 
> is there a simple way to make this plot.
> 

Martin,

perhaps this comes near to what you want:

data = {{0, 0}, {1.9, 2}, {2.1, 5}, {3.2, 3}}; 
{xl, yl} = Transpose[data]
ylp = Rest[FoldList[Plus, 0, yl]]
{pts1, pts2} = {Transpose[{Drop[xl, -1], Rest[ylp]}], 
   Transpose[{xl, ylp}]}

lines = Line /@ Transpose[{pts1, Rest[pts2]}]

<< "Graphics`MultipleListPlot`"

MultipleListPlot[pts1, pts2, pts2, 
  SymbolShape -> {PlotSymbol[Box, Filled -> True], 
    PlotSymbol[Box, Filled -> True], 
    PlotSymbol[Box, Filled -> False]}, 
  SymbolStyle -> {GrayLevel[0], GrayLevel[1]}, 
  Prolog -> lines]
 
Here we have retained an (open) point at {0,0} to make the origin explicit.
You may remove that, and adjust the PlotRange.

-- Hartmut



  • Prev by Date: Re: thickness and fonts of axes & labels
  • Next by Date: Re: Arrow Syntax is Dumb
  • Previous by thread: Re: plotting cadlag point process
  • Next by thread: Re: Mathematica and AVS Visual Express