Re: Plot, Epilog, and Text
- To: mathgroup at smc.vnet.net
- Subject: [mg80824] Re: Plot, Epilog, and Text
- From: "David Park" <djmpark at comcast.net>
- Date: Mon, 3 Sep 2007 06:13:36 -0400 (EDT)
- References: <fbdmo6$pat$1@smc.twtelecom.net>
You specified that the second argument must be a Real. But there is another
surprise. PlotRange -> All does not appear to take into account anything in
Epilog.
f = PDF[NormalDistribution[3, Sqrt[6]], x];
g[X_String, w_Real, f_] :=
Text[Style[X, 12, Bold], {w, f /. {x -> w}}, {0, -2}];
Plot[f,{x,-40,40},
PlotRange->All,
Epilog->{g["X",3.,f]}]
Plot[f, {x, -40, 40},
PlotRange -> {0, 0.2},
Epilog -> {g["X", 3., f]}]
In your second example you did not specify an offset for the Text material
so the X did appear in the plot.
Plot[f, {x, -40, 40}, PlotRange -> All,
Epilog -> {Text[Style["X", 12, Bold], {3, f /. {x -> 3}}]}]
Here is a second example of Epilog not affecting the plot range.
Plot[Sin[x], {x, 0, 2 Pi},
AspectRatio -> Automatic,
Epilog -> Circle[{3, 3}],
PlotRange -> All]
Plot[Sin[x], {x, 0, 2 Pi},
AspectRatio -> Automatic,
Epilog -> Circle[{3, 3}],
PlotRange -> {-1.1, 4.1}]
--
David Park
djmpark at comcast.net
http://home.comcast.net/~djmpark/
"Bruce Colletti" <vze269bv at verizon.net> wrote in message
news:fbdmo6$pat$1 at smc.twtelecom.net...
> 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}}]}]
>
>