RE: Plots with Variable Limits?
- To: mathgroup at smc.vnet.net
- Subject: [mg24120] RE: [mg24100] Plots with Variable Limits?
- From: Wolf Hartmut <hwolf at debis.com>
- Date: Wed, 28 Jun 2000 02:11:42 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
> -----Original Message-----
> From: A. E. Siegman [SMTP:siegman at stanford.edu]
To: mathgroup at smc.vnet.net
> Sent: Tuesday, June 27, 2000 6:52 AM
> To: mathgroup at smc.vnet.net
> Subject: [mg24100] Plots with Variable Limits?
>
> I want to make a test plot of a function f[x,a] versus x for some
> trial value of the parameter a without fixing that parameter for
> subsequent cells, e.g. something like
>
> Plot[ f[r,a], {x,-2a,2a} ] /. a->10
>
> If I try this, Mathematica gives me a "Plot::plln" error -- but then
> goes ahead and makes the correct plot anyway.
>
> I can of course turn off the error -- but what's a better, but still
> clean and simple, way to accomplish this.
>
> Thanks siegman at stanford.edu
>
[Wolf Hartmut]
You just need to wrap Plot with Unevaluated.
Unevaluated[Plot[ f[r,a], {x,-2a,2a} ]] /. a->10
This prevents the evaluation of plot _before_ substitution occurs (which
doesn't work and therefore generates the error message; after the error the
original input was returned which then was replaced and evaluated
correctly).
Kind regards, Hartmut