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

MathGroup Archive 2007

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

Search the Archive

Re: Plot, Epilog, and Text

  • To: mathgroup at smc.vnet.net
  • Subject: [mg80827] Re: [mg80798] Plot, Epilog, and Text
  • From: bsyehuda at gmail.com
  • Date: Mon, 3 Sep 2007 06:15:08 -0400 (EDT)
  • References: <200709020652.CAA25864@smc.twtelecom.net>

Hi,
I find here two problems:
1. The second argument of g is expected to have head Real, while you call it
with the EXACT NUMBER 3 that has a head Integer, so g is not evaluated. This
can be solved by either
1. Calling g with 3.0 (or 3.) and not 3
2. define g as g[X_String,w_(Real|Integer),f_]:=...
or
3. define g as g[X_String,w_?NumberQ,f_]:=...

after fixing this, the PlotRange->All in the first example is not "tall"
enough to show the required "X" string so you need to move from All to more
sepecific value for the vertical axis

regards
yehuda
On 9/2/07, 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}}]}]
>
>
>



  • Prev by Date: Re: Plot, Epilog, and Text
  • Next by Date: Re: Plot, Epilog, and Text
  • Previous by thread: Plot, Epilog, and Text
  • Next by thread: Re: Plot, Epilog, and Text