Re: nestled plotting

• To: mathgroup at smc.vnet.net
• Subject: [mg72362] Re: nestled plotting
• From: "dimitris" <dimmechan at yahoo.com>
• Date: Tue, 26 Dec 2006 08:23:17 -0500 (EST)
• References: <emdors\$jvh\$1@smc.vnet.net>

```Use Evaluate

In[7]:=
Plot[Evaluate[Table[Normal[Series[Sin[x], {x, 0, i}]], {i, 5}]], {x,
-15, 15}, Frame -> {True, True, False, False},
Axes -> False, FrameLabel -> {"x", ""}];

Plot has the Attribute HoldAll.

As Help Browser mentions if Plot is used to plot a list of functions,
that list should appear explicitly as the first argument in Plot or
should be introduced using Evaluate or other means.

In[8]:=
Attributes[Plot]
Out[8]=
{HoldAll, Protected}

The same holds true for e.g. NIntegrate

In[10]:=
NIntegrate[Evaluate[Table[Normal[Series[Sin[x], {x, 0, i}]], {i, 5}]],
{x, -2, 10}]
Out[10]=
{48., 48., -368.0000000000001, -368.0000000000001, 1020.8000000000009}

In[12]:=
Attributes[NIntegrate]
Out[12]=
{HoldAll, Protected}

But e.g.

In[1]:=
Integrate[Table[Normal[Series[Sin[x], {x, 0, i}]], {i, 5}], {x, -2,
10}]
Out[1]=
{48, 48, -368, -368, 5104/5}

In[2]:=
Attributes[Integrate]
Out[2]=

junk at apspektakel.com wrote:
> Hi
>  I'm having this problem. I want to plot a number of maclaurin
> polynomials and I want to do it like this:
> Plot[Table[Normal[Series[Sin[x], {x, 0, i}]], {i, 5}], {x, -15, 15}]
> This gives me a bunch of error messages. However, if I first print the
> table:
> Table[Normal[Series[Sin[x], {x, 0, i}]], {i, 5}]
> and cut and pase this into the plot command, everything works just as I
> want it. How do I get past the cut and paste step?
>