pavetext¶

AddText returns a TText corresponding to the line added to the pave. This return value can be used to modify the text attributes.

Once the TPaveText is build the text of each line can be retrieved as a TText with GetLine and GetLineWith wich is also useful to modify the text attributes of a line.

Author: Olivier Couet
This notebook tutorial was automatically generated with ROOTBOOK-izer from the macro found in the ROOT repository on Monday, August 15, 2022 at 09:36 AM.

In [1]:
TCanvas *c = new TCanvas("c");
TPaveText *pt = new TPaveText(.05,.1,.95,.8);

pt->AddText("A TPaveText can contain severals line of text.");
TText *t1 = pt->AddText("F(t) = #sum_{i=-#infty}^{#infty}A(i)cos#[]{#frac{i}{t+i}}");

t1->SetTextColor(kBlue);

pt->Draw();

TText *t2 = pt->GetLineWith("Even");
t2->SetTextColor(kOrange+1);

return c;


Draw all canvases

In [2]:
gROOT->GetListOfCanvases()->Draw()