SetOptStat breaks axis label containing standard TeX

In the course of trying to make a plot with a lowercase script L in the x-axis title, I discovered that something about using SetOptStat(0) breaks this. If I run the following as a macro, the resulting plot has all the letters in the axis title placed in the same spot in the bottom right corner of the canvas, in an unreadable jumble.

gStyle.SetOptStat(0);
TH1F h = TH1F("h","h",1,0.,1.);
TCanvas c = TCanvas("c","c",1000,1000);
h.GetXaxis().SetTitle("he \\ell\\ell o}");
h.Draw();
c.Print("broken_title.png");

Using ROOT 5.34/30, this happens when I run that code as a macro, but not if I do the same thing interactively. It also happens in pyROOT and rootpy using Python 2.7.9, though not if I use IPython. I wasn’t able to recreate it in ROOT 5.34/20. An example image is attached.

[Edited to add: this only happens with the first image drawn; other plots made with the same script are fine.]

Is this a known issue, or fixed in newer versions?

Thanks!


Thanks I’ll check.

That’s not a SetOptStat issue. You get this when you produce a plot in batch mode using TMathText. I am looking at it now. I do not have the solution yet. The following macro reproduces the problem. I am using this macro to debug.

{
   gROOT->SetBatch(1);
   TCanvas *c = new TCanvas("cname", "ctitle");
   TMathText *mt = new TMathText(.4,.5,"TMathText");
   mt->Draw();
   TLatex *lt = new TLatex(.5,.4,"TLatex");
   lt->Draw();
   c->Print("wrongtext.png");
}

Thanks for taking a look! It’s no rush from me; making a dummy plot at the beginning of my script then ignoring it is a sufficient workaround.

Yes I noticed that to. It is only the 1st plot which has problem, and in batch only. If you do not run in batch it is fine.