Greek sympols in histogram

in a leg I want to have greek symbols. so i write #phi_{pt}. in my canvas, it appears exactly as i have written it! i.e. no conversion to greek phi.

Code:
const char *LegTxt=“0.5 < #phi_{pt} < 3”;
TLegendEntry *e = Leg0->AddEntry(Hist,Form("%s",LegTxt),"");

I do not see this problem:
01
Do you have a small reproducer ?

RepPhi

notice that it works on the x-axis but not in the legend!

I believe you have a problem but I cannot reproduce it with:

{
   auto h = new TH1D("h","h",10,0,1);
   h->Draw();
   auto l = new TLegend(0.2,0.2,0.4,0.4,"legend");
   TLegendEntry *l1 = l->AddEntry(h,"0.5 < #phi_{pt} < 3","fp");
   l->Draw();
}

57

Which ROOT version are you using ? on which machine ?

It could be because of the font being used. This, for instance:

l->SetTextFont(11);

results (root 5.34/38 on Windows) in no conversion. Try setting the font to a number ending in 2, for example (12, 22, …, see https://root.cern.ch/root/html530/TAttText.html#T5).

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.