Re: Re: When is a List not a List?

*To*: mathgroup at smc.vnet.net*Subject*: [mg90961] Re: [mg90956] Re: [mg90947] When is a List not a List?*From*: DrMajorBob <drmajorbob at att.net>*Date*: Fri, 1 Aug 2008 02:58:16 -0400 (EDT)*References*: <200807310656.CAA07700@smc.vnet.net>*Reply-to*: drmajorbob at longhorns.com

But Plot DOES evaluate its arguments, of course, and DOES (eventually) see that multiple functions are being plotted. (Else they couldn't be plotted.) It's just not happening before colors are assigned. Nonetheless, it's prudent to take note of what functions actually do, and get used to it. Calling everything in sight a quirk serves no purpose. (Paraphrasing Andrzej, perhaps.) Bobby On Thu, 31 Jul 2008 05:04:10 -0500, Andrzej Kozlowski <akoz at mimuw.edu.pl> wrote: > There is nothing at all quirky about this. Yes, FullForm[Table[g[x, > n], {n, 1, 2}]] and FullForm[{g[x, 1], g[x, 2]}] are indeed identical, > but that is because FullForm evaluates its argument. But Plot has > attribute: > > In[2]:= Attributes[Plot] > Out[2]= {HoldAll, Protected} > > so, unlike FullForm, it does not evaluate its argument. In your first > example, Plot[{g[x, 1], g[x, 2]}, {x, 0, 1}, PlotStyle -> {Red, > Blue}], the first argument of Plot has an explicit List bracket, so > Plot can see that it supposed to treat the argument as two different > functions, without evaluating the argument. But in the second case, it > does not see an explicit bracket, so it treats the entire expression > as the graph of a single function (in versions of Mathematica before 6 > you would not have got any plot at all in this case). > > If you use Evaluate in the second code you will get the same result as > you get form the first: > > Plot[Evaluate[Table[g[x, n], {n, 1, 2}]], {x, 0, 1}, PlotStyle -> > {Red, Blue}] > > Finally, since you have given ample proof that, in spite of many years > of using Mathematica, you have not mastered its basics (this > particular issue has been raised and answered a countless number of > times on this forum), why do you keep assuming that the problems that > you keep coming across are Mathematica's "quirks" rather than (as is > much more likely) gaps in your won understanding? What do you think of > first year undergraduate students who whenever they do not understand > something in their introductory lectures claim that it is wrong, or > blame their textbook or their lecture rather then themselves? > > Andrzej Kozlowski > > > > On 31 Jul 2008, at 08:56, AES wrote: > >> g[x_, n_] := x^n >> FullForm[Table[g[x, n], {n, 1, 2}]] >> FullForm[{g[x, 1], g[x, 2]}] >> Plot[{g[x, 1], g[x, 2]}, {x, 0, 1}, PlotStyle -> {Red, Blue}] >> Plot[Table[g[x, n], {n, 1, 2}], {x, 0, 1}, PlotStyle -> {Red, Blue}] >> >> The FullForm[]s are identical. One Plot[] has red and blue curves; >> the >> other has two blue curves. >> >> Quirky! >> > > > -- DrMajorBob at longhorns.com

**Re: When is a List not a List?**

**Exported PDFs are too big in file size.**

**Re: When is a List not a List?**

**Re: When is a List not a List?**