Re: A simple problem
- To: mathgroup at smc.vnet.net
- Subject: [mg66281] Re: A simple problem
- From: "Name" <valid at email.cm>
- Date: Sat, 6 May 2006 23:50:50 -0400 (EDT)
- References: <e2i8he$96o$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
{1,2,3} doesn't match {_}. {1} would work.
Not sure if this is what you want...
graphFunc[f_, var_, int_]:=
Show[
Plot[f, Evaluate[Prepend[#, var]], DisplayFunction -> Identity]
&/@ int,
DisplayFunction->$DisplayFunction
]
graphFunc[x^2, x, {{0,1}, {4, 5}}]
Plots x^2 from 0 to 1 and 4 to 5 on the same graph. DisplayFunction used to
suppress intermediate graphs.
"Miguel" <mibelair at hotmail.com> wrote in message
news:e2i8he$96o$1 at smc.vnet.net...
> Hi all,
> I want to define a function to plot a set of functions in different
> intervals.
>
> I define
> graficaF[f_,{interval_},var_]:=Plot[f,{var,First[interval],Last[interval]}].
>
> In[]: graficaF[x^2,{1,2,3},x]
> Out[]: graficaF[x^2,{1,2,3},x]
>
> Where is my error?
>
>