Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Constructing a Label

  • To: mathgroup at smc.vnet.net
  • Subject: [mg93392] Re: Constructing a Label
  • From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 5 Nov 2008 04:58:08 -0500 (EST)
  • Organization: Uni Leipzig
  • References: <gepb15$sfr$1@smc.vnet.net>
  • Reply-to: kuska at informatik.uni-leipzig.de

Hi,

since

Plot[Sin[# x], {x, 0, Pi},
    PlotLabel ->
     "\!\(\*SubscriptBox[\"A\", \"1\"]\)[\!\(\*SuperscriptBox[\"x\", \
\"2\"]\),\[Sum] \!\(\*SubscriptBox[\"x\", \"i\"]\)]=" <>
      ToString[#]] & /@ {1, 2, 3}

work perfect, can you explain what
"looks horribly if A is more complicated"
may mean ?

Regards
   Jens


Nikolaus Rath wrote:
> Hello,
> 
> I want to automatically construct labels of the form
> "A = <value of A>" for a number of plots.
> 
> However, I cannot quite figure out how to generate the above
> expression. My first idea was to construct it as a string
> 
> label = "A = " <> ToString[A]
> 
> but this looks horribly if A is more complicated than just a single
> literal. So I assume that I have to "concatenate" the Mathematica
> expressions "A = " and A (rather than the stringified A). But how do I
> do that? My feeble attempts with
> 
> label = RowBox["A", "=", A]
> 
> are displayed exactly the way I entered them, i.e. with the literal
> "RowBox" printed out.
> 
> 
> Thanks in advance,
> 
>    -Nikolaus
> 
> --
>  =C2=BBIt is not worth an intelligent man's time to be in the majority.
>   By definition, there are already enough people to do that.=C2=AB
>                                                          -J.H. Hardy
> 
>   PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C
> 


  • Prev by Date: Re: Mathematica Help Urgent (Very New Beginner)
  • Next by Date: Re: Mathematica Help Urgent (Very New Beginner)
  • Previous by thread: Re: Constructing a Label
  • Next by thread: Re: Constructing a Label