Newbie question about rules
- To: mathgroup at smc.vnet.net
- Subject: [mg21363] Newbie question about rules
- From: dougn_NOspam at gte.net (Doug Nelson)
- Date: Wed, 29 Dec 1999 14:15:49 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hello All, I just received my copy of Mathematica 4.0 and I've been reading Mastering Mathematica. I'm trying to apply a rule that changes "Sin" to "Cos" in an expression. It seems to work fine with normal expressions, but not with a Plot function. This works: exp2 := Abcfunc[Sin[x]] exp2 /. Sin -> Cos out = Abcfunc[Cos[x]] However, the following gives me a sine wave plot in both cases: exp := Plot[Sin[x], {x,0,2 Pi}] exp out = < a sine wave plot > exp /. Sin -> Cos out = < another sine wave plot ! > Why don't I get a cosine plot? Thanks in advance, Doug
- Follow-Ups:
- Re: Newbie question about rules
- From: Ken Levasseur <Kenneth_Levasseur@uml.edu>
- Re: Newbie question about rules