Problem with text size and color in TLatex

Hi,

I am trying to write latex on canvas and set the text size and color. But SetTextSize() and SetTextColor() is not working.

TCanvas *c = new TCanvas("c", "c", 800, 650); c->cd(); TLatex *tex = new TLatex(); tex->SetNDC(); tex->DrawLatex(0.2, 0.2, "test"); tex->SetTextSizePixels(20); // there is no effect of this line tex->SetTextColor(2); // there is no effect of this line

Is there any other way to do this? I am using root 5.22.

Thanks.

try:

{
   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();
}

It works. Thanks.