Re: [ROOT] TLatex vertical alignment

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Aug 08 2000 - 18:05:43 MEST


Hi Stephen,
I understand your point in this particular example, but your proposal would have
plenty of side effects. For example, what would you propose for the 3rd Tlatex
string in my macro below?

Rene Brun

{
  gROOT->Reset();
  TCanvas c1("c1");
  c1.SetGrid();
  TH2F h("h","",2,0,1,2,0,1);
  h.Draw();
  TLatex latex;
  latex.DrawLatex(0.1, 0.5, "K_{S}");
  TLatex *l=(TLatex*)latex.DrawLatex(0.1, 0.3, "K^{*0}");
  latex.DrawLatex(.1,.1,"#frac{2s}{#pi#alpha^{2}}\
 #frac{d#sigma}{dcos#theta} (e^{+}e^{-} #rightarrow f#bar{f} ) =\
 #left| #frac{1}{1 - #Delta#alpha} #right|^{2} (1+cos^{2}#theta)");
}



Stephen Bailey wrote:
> 
> Hi Rooters,
> 
> TLatex appears to vertically align text based upon
> the lowest/highest element drawn, including sub/superscripts.
> e.g.
> 
>   TLatex latex;
>   latex.SetNDC();
>   latex.DrawLatex(0.5, 0.5, "K_{S}");
>   latex.DrawLatex(0.6, 0.5, "K^{*0}");
> 
> aligns the bottom of the subscripted "S" with the bottom of the
> other K.  I would prefer the alignment to be based upon the bottom
> of the normal script, i.e. have the two K aligned and have the
> S be lowered from there and the *0 be raised.
> 
> Do others agree?  Would this be easily possible?
> 
> Thanks.
> 
> Stephen



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:31 MET