Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2005
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: a question about plot a list of functions.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg58214] Re: a question about plot a list of functions.
  • From: dh <dh at metrohm.ch>
  • Date: Thu, 23 Jun 2005 05:33:50 -0400 (EDT)
  • References: <d9av6m$vn$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi Zhou,
Plot does not evaluate its arguments automatically (Attribute: HoldAll).
Therefore, you must use Evaluate:
Plot[Evaluate[y],{x,0,10Pi}]

sincerely, Daniel

Zhou Jiang wrote:
> I defined a function as
>  
> K=(2 r/(1-r^2))^2;
> y=1/(1+K (Sin[x])^2);
> y=y/.{r->{0.2,0.9,0.995}}
>  
> Now the result is a list.
> I want to plot y vs. x in one figure and I did the following
>  
> Plot[y, {x, 0, 10 Pi}];
>  
> But Mathematica gave me an error.
> I changed it to
>  
> Plot[{y[[1]], y[[2]], y[[3]]}, {x, 0, 10 Pi}];
>  
> Mathematica gave me a correct plot. Can anyone give me some idea why the error message is given by Mathematica since y is a list and nothing is diffrent from {y[[1]], y[[2]], y[[3]]}? 
>  
> Thanks.
> 
> 


  • Prev by Date: Pattern Matching
  • Next by Date: Simplify and Memory
  • Previous by thread: Re: a question about plot a list of functions.
  • Next by thread: Re: a question about plot a list of functions.