MathGroup Archive 2009

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

Search the Archive

Re: What's going on here (Table-generated lists)?

  • To: mathgroup at
  • Subject: [mg98092] Re: What's going on here (Table-generated lists)?
  • From: Albert Retey <awnl at>
  • Date: Mon, 30 Mar 2009 04:41:38 -0500 (EST)
  • References: <gqfl2e$ksp$> <gqiaag$op5$> <gqkuvv$4bt$>

Erik Max Francis wrote:

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

I think it is a general problem: how many colors would you expect for this:

Plot[Table[x^n, {n, 0, Floor[x]}], {x, 1, 10}, PlotRange -> All]

or for this:

f[x_] := (Pause[120]; Exp[x])

f[x_?NumericQ] := {Exp[x], Log[x]}

Plot[f[x], {x, 0, 1}]

Of course Plot could be programmed so that it detects more unambiguous
cases and not only explicit Lists, but it also need to be reasonably
fast, so there always is a limit on what it can handle "as intended". I
think the current behaviour is not too bad and there is a very simple
workaround with which you can control exactly what it will do...


  • Prev by Date: Re: irrational and real exponents
  • Next by Date: Re: What's going on here (Table-generated lists)?
  • Previous by thread: Re: What's going on here (Table-generated lists)?
  • Next by thread: Re: What's going on here (Table-generated lists)?