32 TCanvas *c1 =
new TCanvas(
"c1",
"Canvas Example",200,10,600,480);
34 gBenchmark->Start(
"canvas");
37 TPad *pad1 =
new TPad(
"pad1",
"This is pad1",0.05,0.52,0.95,0.97);
38 TPad *pad2 =
new TPad(
"pad2",
"This is pad2",0.05,0.02,0.95,0.47);
39 pad1->SetFillColor(11);
40 pad2->SetFillColor(11);
48 TPad *pad21 =
new TPad(
"pad21",
"First subpad of pad2",0.02,0.05,0.48,0.95,17,3);
49 TPad *pad22 =
new TPad(
"pad22",
"Second subpad of pad2",0.52,0.05,0.98,0.95,17,3);
57 TText *t1 =
new TText(0.5,yt1,
"ROOT");
59 t1->SetTextSize(0.05);
61 TLine *line1 =
new TLine(0.05,0.05,0.80,0.70);
62 line1->SetLineWidth(8);
63 line1->SetLineColor(2);
65 line1->DrawLine(0.6,0.1,0.9,0.9);
66 TLine *line2 =
new TLine(0.05,0.70,0.50,0.10);
67 line2->SetLineWidth(4);
68 line2->SetLineColor(5);
72 TText *t21 =
new TText(0.05,0.8,
"This is pad21");
73 t21->SetTextSize(0.1);
77 TPavesText *paves =
new TPavesText(0.1,0.1,xp2,yp2);
78 paves->AddText(
"This is a PavesText");
79 paves->AddText(
"You can add new lines");
80 paves->AddText(
"Text formatting is automatic");
81 paves->SetFillColor(43);
84 TText *t22 =
new TText(0.05,0.8,
"This is pad22");
85 t22->SetTextSize(0.1);
89 TPaveLabel *label =
new TPaveLabel(xlc, ylc, xlc+0.8, ylc+0.1,
"This is a PaveLabel");
90 label->SetFillColor(24);
95 float dxp2 = (0.9-xp2)/nloops;
96 float dyp2 = (0.7-yp2)/nloops;
97 float dxlc = (0.1-xlc)/nloops;
98 float dylc = (0.4-xlc)/nloops;
99 float dxt1 = (0.5-xt1)/nloops;
100 float dyt1 = (0.8-yt1)/nloops;
101 float t10 = t1->GetTextSize();
103 float t1ds = (t1end - t10)/nloops;
105 for (
int i=0;i<nloops;i++) {
108 line1->SetLineColor(color);
109 t1->SetTextSize(t10 + t1ds*i);
110 t1->SetTextColor(color);
111 t1->SetX(xt1+dxt1*i);
112 t1->SetY(yt1+dyt1*i);
114 paves->SetX2NDC(xp2+dxp2*i);
115 paves->SetY2NDC(yp2+dyp2*i);
117 label->SetX1NDC(xlc+dxlc*i);
118 label->SetY1NDC(ylc+dylc*i);
119 label->SetX2NDC(xlc+dxlc*i+0.8);
120 label->SetY2NDC(ylc+dylc*i+0.2);
124 gBenchmark->Show(
"canvas");