Issue with text size and color in TLatex

Hi,

I just noticed that TLatex is not drawn with the correct color and size when using latex syntax

{
   TCanvas *c = new TCanvas("c", "c",523,105,800,652);
   TLatex *   tex = new TLatex(0.2,0.2,"\\sigma");
   tex->SetTextColor(2); // no effect
   tex->SetTextSize(0.1); // no effect
   tex->Draw();
}

However, without latex this works:

{
   TCanvas *c = new TCanvas("c", "c",523,105,800,652);
   TLatex *   tex = new TLatex(0.2,0.2,"test");
   tex->SetTextColor(2);
   tex->SetTextSize(0.1);
   tex->Draw();
}

Is there any easy fix for that ?

I ll check.

TLatex *   tex = new TLatex(0.2,0.2,"#sigma");

is ok though.
Note that on the color is not taken in to account.
The size is. try tex->SetTextSize(0.8)

1 Like

This PR fixes the color issue. Thanks to have seen the problem.

Ah, I just noticed there are two syntaxes. Thanks for the great investigation!