MathGroup Archive 2005

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

Search the Archive

Re: Plotting lists of functions


Plot[Evaluate[listOfFunctions], {x, 0, 1}];

Because 

"Plot evaluates its arguments in a non-standard way (see Section A.4.2). You 
should use Evaluate to evaluate the function to be plotted if this can safely be 
done before specific numerical values are supplied."


Bob Hanlon

> 
> From: dbae at maths.warwick.ac.uk (David Epstein)
To: mathgroup at smc.vnet.net
> Date: 2005/01/22 Sat AM 03:51:45 EST
> To: mathgroup at smc.vnet.net
> Subject: [mg53689] [mg53665] Plotting lists of functions
> 
> Try this in Mathematica:
> 
> Plot[{1, 2}, {x, 0, 1}]
> listOfFunctions = Table[i, {i, 1, 2}] (*now listOfFunctions equals
> {1,2}*)
> Plot[listOfFunctions, {x, 0, 1}]
> 
> Can anyone tell me a) WHY the first Plot instruction works and the
> second doesn't and
> b) How I can MAKE this kind of construction work. I need the
> construction in a much more general context than this---this is the
> simplest example where the "obvious" code screws up.
> 
> I tried the archives of the mailing lists, but they all refer to
> EFFICIENCY questions. I can't even get Mathematica to parse the above
> 3 lines of code.
> 
> Please copy any responses to dbae at maths.warwick.ac.uk, because I don't
> read the Mathematica mailing list.
> 
> Thanks a lot
> David
> 
> 


  • Prev by Date: Re: Re: Function Fitting To 3D Data
  • Next by Date: Re: about PATTERNS
  • Previous by thread: Re: Plotting lists of functions
  • Next by thread: Monte Carlo Simulation Experiences