Text problem in a pad with array of histogram

Hi,
I have this commend :

c3->Divide(2,6);
ps->NewPage();
TPaveText *pt=new TPaveText(0.63, 0.48, 0.85, 0.54,"brNDC");
sprintf(cha[4],"%d-%d-%d",p1,p2,p3);
TText *tex=pt->AddText(cha[4]);
pt->Draw();
for(int i=3;i<13;i++){
     c3->cd(i);
     h[i+8]->Draw("colz");   p->Draw("SAMEP");
}
 c3->Update();

but when I run my program there is an empty space at the top of the canvas but I can’t see any text in canvas or ps file
please help me

{
  Int_t p1 = 10, p2 = 20, p3 = 30;
  TCanvas *c3 = new TCanvas("c3", "c3");
  c3->Divide(2,6);
  TPaveText *pt = new TPaveText(0.63, 0.48, 0.85, 0.54, "brNDC");
  TString cha = TString::Format("%d-%d-%d", p1, p2, p3);
  pt->AddText(cha);
  for(int i = 1; i < 13; i++) {
    c3->cd(i);
    pt->Draw();
  }
  c3->cd(0);
  c3->Modified(); c3->Update();
}

thank you;
I need this text only for the top of the canvas not for each pad. I assume that i need tow pads for text and array of histograms start form i=3. whit your suggestion all of my pads have text.

In the loop just do:

    if (i<3) pt->Draw();

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.