Re: Non-interpreted TLatex in axis titles

From: Philip Rodrigues <p.rodrigues1_at_physics.ox.ac.uk>
Date: Mon, 25 May 2009 18:10:16 +0100


Hi Olivier,
Argh, I pasted the wrong bit of code into my original message - if I do use gStyle->SetTitleFont(60,"xy"), I get the behaviour I described. Is there a way around it?

Thanks,
Philip

On Monday 25 May 2009 11:57:30 Olivier Couet wrote:
> 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 - 19:10:28 CEST

This archive was generated by hypermail 2.2.0 : Tue May 26 2009 - 17:50:04 CEST