RE: Non-interpreted TLatex in axis titles

From: Olivier Couet <Olivier.Couet_at_cern.ch>
Date: Mon, 25 May 2009 12:57:30 +0200


You should do:

gStyle->SetTitleFont(60,"xy");

See:

http://root.cern.ch/root/html/TStyle.html#TStyle:SetTitleFont

-----Original Message-----
From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch] On Behalf Of Philip Rodrigues
Sent: Monday, May 25, 2009 12:52 PM
To: roottalk_at_root.cern.ch
Subject: [ROOT] Non-interpreted TLatex in axis titles

Hi roottalk,
I'm trying to draw an axis title with low font precision so that the latex
isn't interpreted, like this:

root [0] gStyle->SetTitleFont(60)
root [1] TH1F* h=new TH1F("foo", "bar;#int;#int", 10, 0, 1)
root [2] h->Draw()

This puts "#int" on the axes (which is what I want), but the one on the y axis
isn't rotated, as usual. I guess this is because TLatex::PaintLatex has:

if (fTextFont%10 < 2) {

      gPad->PaintText(x,y,text1);
      return;

}

which doesn't pass the angle, so it's drawn unrotated. But if I create a

TLatex manually and set its font and angle, it *is* rotated:

root [0] TLatex la;
root [1] la.SetTextFont(60)
root [2] la.SetTextAngle(90)
root [3] la.DrawLatex(0.5, 0.5, "#int")

so I'm a little confused as to what's going on.

Anyway, my question is: Is there a way I can get this behaviour (latex not
interpreted, text rotated) for the y axis title?

Regards,
Philip Received on Mon May 25 2009 - 12:57:34 CEST

This archive was generated by hypermail 2.2.0 : Mon May 25 2009 - 23:50:01 CEST