MathGroup Archive 1992

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

Search the Archive

Re: text in graphics

  • To: mathgroup at
  • Subject: Re: text in graphics
  • From: ross at (Ross Moore)
  • Date: Wed, 3 Jun 92 18:13:06 +1000

Gerhold Fasol asks...

Does anybody know if some TeX-like method
exists to produce exponents etc in FrameLabels and other text within

Yes, you can do exponents and subscripts and other fonts.
For fonts you use  FontForm[]  see pp467-470 of the bible.
This section also explains how to position pieces of text at 
desired locations, and oriented at specified angles.

There is a catch that is not mentioned which may be applicable if
you are using non-standard fonts, or non-standard symbols within
standard fonts. Basically the problem is with PostScript, not Mma.
It relates to character codes of the characters within a font.
Typing a, b, c, ... A, B, C, ... will get you most characters but 
there may be some, with codes 128--255 that cannot be generated this way.
To get these you must type \xyz  where xyz is the 3-digit Octal representation
of the desired character. e.g. \260 produces an  infinity  symbol in many
Macintosh fonts.
Show @ Graphics[

produces the desired symbol, and prints correctly.

WARNING: FontForm["\260",{Times-Roman",36}] also gives an infinity
symbol on screen, but it does not print. This is because there is no
character \260 in the PostScript Times-Roman font. The Mac references
this character from the Symbol font.

To get exponents for labels, the easiest way is to use  OutputForm .
For example,

PlotLabel -> "f(x) = " (5/4 x^(4/5) //OutputForm) 

gives a label formatted in the same way as you get with:

Print[ "f(x) = ", 5/4 x^(4/5) ];

       5 x
f(x) = ------

If the spacings and/or sizes are not to your liking here, you might try
hacking at the PostScript code to get what you want.

Ross Moore.

  • Prev by Date: Re: text in graphics
  • Next by Date: Algebraic Numbers
  • Previous by thread: Re: text in graphics
  • Next by thread: Re: text in graphics