Re: Plot, Epilog, and Text

*To*: mathgroup at smc.vnet.net*Subject*: [mg80815] Re: [mg80798] Plot, Epilog, and Text*From*: DrMajorBob <drmajorbob at bigfoot.com>*Date*: Mon, 3 Sep 2007 06:09:00 -0400 (EDT)*References*: <26186458.1188725719526.JavaMail.root@m35>*Reply-to*: drmajorbob at bigfoot.com

Bruce, Your pattern for g includes w_Real, but in the plot you passed an Integer (3) in that position. You could pass 3.0 instead, or you can change the definition to g[X_String, w_?NumericQ, f_] := Text[Style[X, 12, Bold], {w, f /. {x -> w}}, {0, -2}] or even g[X_String, w_, f_] := Text[Style[X, 12, Bold], {w, f /. {x -> w}}, {0, -2}] Bobby On Sun, 02 Sep 2007 01:52:23 -0500, Bruce Colletti <vze269bv at verizon.net> wrote: > Re 6.0.1 under WinXP. > Why does the first Plot fail but not the second? > > They seem equivalent: the former simply uses a function to implement > the Text command that is explicit in the second Plot. > > Thankx. > > Bruce > > f=PDF[NormalDistribution[3,Sqrt[6]],x]; > g[X_String,w_Real,f_]:=Text[Style[X,12,Bold],{w,f/.{x->w}},{0,-2}]; > > Clear@x; > Plot[f,{x,-40,40},PlotRange->All,Epilog->{g["X",3,f]}] > > Plot[f,{x,-40,40},PlotRange->All,Epilog->{Text[Style["X",12,Bold],{3,f/.{x->3}}]}] > > > -- DrMajorBob at bigfoot.com