TMathText bug (maybe)

Hello everyone,

I have crossed by what seems to be a bug in the TMathText class, when plotting a graph with high values in the x axis the “\” symbols doesn’t seems to work anymore. Here is a quit test that you can check in the command lines:

//NOTWORKING
vector<double> a = {1.6014205e+09, 1.6015069e+09, 1.6015933e+09, 1.6016797e+09, 1.6017661e+09, 1.6018525e+09, 1.6019389e+09, 1.6020253e+09, 1.6021117e+09, 1.6021981e+09};
vector<double> b = {1,2,3,4,5,6,7,8,9,10}
TGraph g( a.size(), &a[0], &b[0]);
g.Draw("alp");
TLatex l;
l.DrawLatex(1.6015069e+09, 1, "Ciao");
l.DrawLatex(1.6015069e+09, 2, "\\mapsto");
//WORKING
new TCanvas;
vector<double> c = {10,9,8,7,6,5,4,3,2,1};
TGraph gg( c.size(), &b[0], &c[0]);
gg.Draw();
l.DrawLatex(1, 1, "Ciao");
l.DrawLatex(1, 2, "\\mapsto");

Does anyone know why the arrow doesn’t show in the first plot ?

Cheers,
Henrique


ROOT Version: 6.20/00
Platform: Linux Ubuntu 18.04
Compiler: g++ and gcc 7.5.0


1 Like

Yes this is weird.
I see this effect too.
This is a good candidate for a github issue.

1 Like

Using \# seems to work for the symbols in the TLatex documentation. This works, for instance:

   TLatex *tex = new TLatex(1.601507e+09,4,"\#subset");

But for mapsto, which is not listed, it doesn’t work.

Yes, everything from TLatex seems to be working properly, except TMathText commands (here)

There is a real issue with TMathText. None TMathText character work. Example:

l.DrawLatex(1.6015069e+09, 2, "\\alpha");

Can you create a GitHub issue with that ?

Edit: let me know if you want me to do it for you.

a simpler reproducer is:

{
   TLatex l;
   auto c = new TCanvas();
   c->DrawFrame(1.6014205e+09,0.,1.6021981e+09,3.);
   l.DrawLatex(1.6015069e+09, 1, "#alpha #beta #gamma ");
   l.DrawLatex(1.6015069e+09, 2, "\\alpha \\beta \\gamma");
}

Dear Couet,

I kindly ask you to open the issue, as I don’t know how to do it.

Cheers,
Henrique

Done: TMathText does not display with high value coordinates · Issue #7212 · root-project/root · GitHub

1 Like

Once merged, this PR fixes it.

Many thanks

The PR is now merged. Thanks to have seen this problem.