MathGroup Archive 2006

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

Search the Archive

Re: A simple problem


Miguel wrote:
> 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?
> 
Hi Miguel,
Try

graficaF[f_, interval:{_, __}, var_] :=
   Plot[f, {var, First[interval], Last[interval]}]

HTH,
Jean-Marc


  • Prev by Date: Re: Width of plots
  • Next by Date: Re: how to iterate
  • Previous by thread: Re: A simple problem
  • Next by thread: Re: A simple problem