       Re: Plotting a series of piecewise functions

• To: mathgroup at smc.vnet.net
• Subject: [mg88955] Re: Plotting a series of piecewise functions
• From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
• Date: Thu, 22 May 2008 02:36:45 -0400 (EDT)
• Organization: Uni Leipzig
• References: <g11r06\$a7i\$1@smc.vnet.net>

```Hi,

you can plot it when you find out that xo is different from x0
because o is a letter and 0 is a digit

Plot[Evaluate[Table[f[lambda,x0,x],{lambda,0.5,0.5},{x0,4}]],{x,0,10}]

when you define

f[lambda_, xo_, x_] :=
Piecewise[{{lambda*Exp[-lambda*(x - xo)], x > xo}}, 0]

Regards
Jens

Claus wrote:
> Hi,
> I want to plot a series of functions. Namely I want to plot a series of
> 2-parametric exponential distribution functions. By series I mean the
> graphs for various xo values on one plot.
> So,
> the function looks like this:
>
> f[lambda_, xo_, x_]:=lambda*Exp[-lambda*(x-xo)]
>
> Now I can plot this (wrongly) with
>
> Plot[Evaluate[Table[f[lambda,xo,x],{lambda,0.5,0.5},{x0,4}]],{x,0,10}]
>
> The problem is that, really, f should be zero for x<xo.
> I can plot one graph (for xo=1 and lambda=1) like this:
>
> Plot[Piecewise[{{f[0.5,1,x],x>1},{0,x<1}}],{x,0,10}]
>
> Now, how could I plot a series of plots (for different xo) on one chart
> similarly to the Piecwise approach (can I do it with Piecewise at all,
> or do I need an If clause of sorts)?
>
> Thank you for your help,
> Claus
>

```

• Prev by Date: Re: Color space conversion in Mathematica v6.0
• Next by Date: Re: On which OS is Mathematica best implemented?
• Previous by thread: Plotting a series of piecewise functions
• Next by thread: Re: Plotting a series of piecewise functions