Logo ROOT   6.07/09
Reference Guide
pavetext.C
Go to the documentation of this file.
1 /// \file
2 /// \ingroup tutorial_graphics
3 /// \notebook
4 /// Draw a pave text.
5 ///
6 /// \macro_image
7 /// \macro_code
8 ///
9 /// \author Olivier Couet
10 
11 TCanvas *pavetext(){
12  TCanvas *c = new TCanvas("c");
13  TPaveText *pt = new TPaveText(.05,.1,.95,.8);
14 
15  pt->AddText("A TPaveText can contain severals line of text.");
16  pt->AddText("They are added to the pave using the AddText method.");
17  pt->AddLine(.0,.5,1.,.5);
18  pt->AddText("Even complex TLatex formulas can be added:");
19  pt->AddText("F(t) = #sum_{i=-#infty}^{#infty}A(i)cos#[]{#frac{i}{t+i}}");
20 
21  pt->Draw();
22  return c;
23 }
virtual void Draw(Option_t *option="")
Draw this pavetext with its current attributes.
Definition: TPaveText.cxx:211
return c
virtual TLine * AddLine(Double_t x1=0, Double_t y1=0, Double_t x2=0, Double_t y2=0)
Add a new graphics line to this pavetext.
Definition: TPaveText.cxx:147
virtual TText * AddText(Double_t x1, Double_t y1, const char *label)
Add a new Text line to this pavetext at given coordinates.
Definition: TPaveText.cxx:160
TPaveText * pt
The Canvas class.
Definition: TCanvas.h:41
A Pave (see TPave) with text, lines or/and boxes inside.
Definition: TPaveText.h:27