Plotting a series of piecewise functions
- To: mathgroup at smc.vnet.net
- Subject: [mg88905] Plotting a series of piecewise functions
- From: Claus <clausenator at gmail.com>
- Date: Wed, 21 May 2008 14:48:08 -0400 (EDT)
- Organization: Comp.Center (RUS), U of Stuttgart, FRG
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