Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: Plotting lists of functions

  • To: mathgroup at smc.vnet.net
  • Subject: [mg53691] Re: Plotting lists of functions
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Sun, 23 Jan 2005 02:02:21 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

On 1/22/05 at 3:51 AM, dbae at maths.warwick.ac.uk (David Epstein)
wrote:

>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.

This occurs because of the way Mathematica evaluates expressions in Plot. See section 1.9.1 of the Mathematica Book for an explanation. The "cure" is to force evaluation of the expression before Plot sees it. That is

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

will do what you want
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: PlotLegend not an option for PLot? 5.1
  • Next by Date: Re: PlotLegend not an option for PLot? 5.1
  • Previous by thread: Re: Plotting lists of functions
  • Next by thread: Re: Plotting lists of functions