MathGroup Archive 2002

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

Search the Archive

Re: PlotLabel


In a message dated 8/31/02 1:29:33 AM, giroux at dms.umontreal.ca writes:


> I plot several curve depending on a parameter p and I want the PlotLabel to
> show the value of p.
> What is wrong with the following ?
>
> pl[p_]:=Plot[Sin[x^p],{x,0,Pi},PlotLabel\[Rule] "p = " p,
>   DisplayFunction\[Rule]Identity]
>
> Table[Show[pl[k],DisplayFunction\[Rule]$DisplayFunction],{k,3}]
>

Use ToString and StringJoin


pl[p_]:=Plot[Sin[x^p],{x,0,Pi},

       PlotLabel->"p = " <> ToString[p],

       DisplayFunction->Identity];


Alternatively, you could use StringForm


pl[p_]:=Plot[Sin[x^p],{x,0,Pi},

       PlotLabel->StringForm["p = ``" , p],

       DisplayFunction->Identity];



Bob Hanlon
Chantilly, VA   USA




  • Prev by Date: Re: How to ...?
  • Next by Date: Re: How to ...?
  • Previous by thread: RE: PlotLabel
  • Next by thread: RE: PlotLabel