MathGroup Archive 2006

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

Search the Archive

Re: A simple problem

  • To: mathgroup at smc.vnet.net
  • Subject: [mg65979] Re: A simple problem
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Tue, 25 Apr 2006 05:19:14 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <e2i8he$96o$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

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