Problem with TPostScript and divided Canvas

Hi,
I’m makeing a .ps file and using divided canvases. After using a divided canvas, I can’t get the Canvas to go back to a singal pad in the postscript file. The screen display works ok, but the .ps file overwrited the single image on top of the divided image.

Here is my code: - thanks - Ken

{
gROOT->Reset();

TFile f(“histo.root”,“READ”);

TPostScript ps(“h1.ps”,111);

c1 = new TCanvas(“c1”,“sub data”,200,10,700,500);

c1.Divide(2,2);

c1.cd(1);
TH1F *hnumcalls = f->Get(“numcalls”);
hnumcalls->Draw();c1.Update();

c1.cd(2);
TH1F* hcallanstime0 = f->Get( “callanstime0” );
hcallanstime0->Draw();c1.Update();

c1.cd(3);
TH1F* hcallanstime51 = f->Get( “callanstime51” );
hcallanstime51->Draw();c1.Update();

c1.cd(4);
TH1F* hcallanstime451 = f->Get( “callanstime451” );
hcallanstime451->Draw();c1.Update();

c1.Divide(1,1);
c1.cd(0);
hcallanstime0->Draw();c2.Update();

ps.Close();

}

I suppose you would like to get 2 pages. The way to do it is:

{
gROOT->Reset();

TFile f(“hsimple.root”,“READ”);

c1 = new TCanvas(“c1”,“sub data”,200,10,700,500);

c1.Divide(2,2);

c1.cd(1);
hpx->Draw();

c1.cd(2);
hpx->Draw();

c1.cd(3);
hpx->Draw();

c1.cd(4);
hpx->Draw();
c1->Print(“h1.ps(”,“ps”);

c1.Divide(1,1);
c1.cd(0);
hpx->Draw();
c1->Print(“h1.ps)”,“ps”);

}

NB: As you haven’t send the data file I have modified your macro to use one of the standard ROOT example

Thanks alot, that did it.

I’m seeing one glitch in the ouput .ps however. Some plots don’t get their title printed.

relative files are attached:
makepic_term.c (1.94 KB)
histo.root (42.4 KB)
h1.ps (156 KB)

Some of the histograms title are a bit long and do not have enough room to fits on the plots when the Pad is divided. One possible way is to do the following:

   callhr_120->SetTitle("#splitline{terminations vs hr with prior}
                                   {stationary call between 60 - 120 min}");
   callhr_120->Draw();

:slight_smile: thank you!