Re: text in histograms

Rene Brun (Rene.Brun@cern.ch)
Tue, 12 Aug 1997 14:41:15 +0200


Elemer Nagy wrote:
>
> Can anybody write me down the character sequence in ROOT for the
> following text to be written on a histogram axis, here written in TeX-style:
>
> M_{\mu^+\mu^-}^2
>

Drawing superscripts and subscripts is only supported for Postscript
output. Examples are given at :
http://root.cern.ch/root/html/TPostScript.html
The list of special escape characters is given at:
http://root.cern.ch/root/html/TPostScript.html#TPostScript:Text

Note that only one level of super/subscript is supported.
Your example can be encoded as illustrated by the following macro:
{
gROOT->Reset();
c1 = new TCanvas("c1","mumu example",400,600);
text = new TText();
text->SetTextSize(0.1);
text->SetTextAlign(22);
text->DrawText(.5,.5,"M^2?`m!+?m!-#");
c1->Print("mumu.ps");
gSystem->Exec("gs mumu.ps");
}

Rene Brun