Re: What's going on here (Table-generated lists)?
- To: mathgroup at smc.vnet.net
- Subject: [mg98031] Re: What's going on here (Table-generated lists)?
- From: Erik Max Francis <max at alcyone.com>
- Date: Sat, 28 Mar 2009 05:43:51 -0500 (EST)
- References: <firstname.lastname@example.org> <email@example.com>
Szabolcs Horv=E1t wrote: > Erik Max Francis wrote: >> What is going on here? Is it something like Plot does a special scan = of >> its first argument before Evaluating it, and if it doesn't start out a= s >> a List, it concludes that it's all one thing and plots it with the sam= e >> color, as opposed to an explicitly provided list of separate colors? > > Yes, that is right. > > In newer versions of Mathematica, Plot is a complicated function that= > tries to guess whether the argument you provided needs to be evaluated > symbolically before substituting in numerical values for the plot > variable, or not. Of course it cannot always guess right. In this cas= e > it doesn't evaluate the Table before starting the plotting, so it think= s > that it'll have only one thing to plot, and thus it uses only one colou= r. > > IMO this is quite silly. If it is able to plot all five lines, it > should be able to figure out that it needs five colours ... Thanks to you and everyone who responded. I do understand the HoldAll attribute and why Plot is doing what it's doing. I fully understand why the HoldAll attribute is generally useful and why it's used here, but I still don't see why it doesn't make sense for Plot to recognize a list as an actual list and plot each with a different color. Shouldn't it be manually evaluating its argument, then plotting with different colors if it ends up with a list? Is there any particular situation where you'd want the current behavior -- not the HoldAll, but rather the plotting what ends up being a list of functions with the same color? -- Erik Max Francis && max at alcyone.com && http://www.alcyone.com/max/ San Jose, CA, USA && 37 18 N 121 57 W && AIM, Y!M erikmaxfrancis Always forgive your enemies -- nothing annoys them so much. -- Oscar Wilde