       Re: Oddities of Plot[]

• To: mathgroup at smc.vnet.net
• Subject: [mg51154] Re: [mg51123] Oddities of Plot[]
• From: DrBob <drbob at bigfoot.com>
• Date: Wed, 6 Oct 2004 04:34:45 -0400 (EDT)
• References: <200410050837.EAA08407@smc.vnet.net>
• Reply-to: drbob at bigfoot.com
• Sender: owner-wri-mathgroup at wolfram.com

```What you're missing is Evaluate.

For instance,

circle = Solve[r^2 == (x - h)^2 + (y - k)^2, y];
primitivelow = y /. circle[] /. {r -> 1, h -> 0, k -> 0};
primitivehigh = y /. circle[] /. {r -> 1, h -> 0, k -> 0};
primitive = {primitivehigh, primitivelow};
Plot[primitive // Evaluate, {x, 0, 1}]

or

circle = Solve[r^2 == (x - h)^2 + (y - k)^2, y];
primitive = y /. circle /. {r -> 1, h -> 0, k -> 0};
Plot[primitive // Evaluate, {x, 0, 1}]

or

circle = Solve[r^2 == (x - h)^2 + (y - k)^2, y];
Plot[y /. circle /. {r -> 1, h -> 0, k -> 0} // Evaluate, {x, 0, 1}]

or

circle = Solve[r^2 == (x - h)^2 + (y - k)^2, y];
Plot[Evaluate[y /. circle /. {r -> 1, h -> 0, k -> 0}], {x, 0, 1}]

Bobby

On Tue, 5 Oct 2004 04:37:12 -0400 (EDT), Roger Mason <rmason at esd.mun.ca> wrote:

> Hello,
>
> Playing around in Mathematica 4 I came across this oddity:
>
> In:=
> circle = Solve[r^2 == (x - h)^2 + (y - k)^2, y]
> Out=
> {{y -> k - Sqrt[-h^2 + r^2 + 2 h x - x^2]}, {y ->
>         k + Sqrt[-h^2 + r^2 + 2 h x - x^2]}}
>
> In:=
> primitivelow = y /. circle[] /. {r -> 1 , h -> 0, k -> 0};
> primitivehigh = y /. circle[] /. {r -> 1 , h -> 0, k -> 0};
> primitive = {primitivehigh, primitivelow}
> Out=
> {1 - x^2, -1 - x^2}
>
> I don't see why this fails
>
> In:=
> Plot[primitive, {x, 0, 1}]
> Plot::"plnr": "primitive is not a
> machine-size real number at x = 4.166666666666666`*^-8."
>
> while this works
>
> In:=
> Plot[{1 - x^2, -1 - x^2}, {x, 0, 1}]
>
> Thanks,
>
> Roger Mason
>
>
>
>

--
DrBob at bigfoot.com
www.eclecticdreams.net

```

• Prev by Date: Re: Re: A way around the limitations of Re[] and Im[]
• Next by Date: Re: normal distribution random number generation
• Previous by thread: Re: Oddities of Plot[]
• Next by thread: Re: Oddities of Plot[]