(no subject)

Rene Brun (Rene.Brun@cern.ch)
Mon, 14 Jun 1999 15:40:57 +0000


Hi Marek,
I cannot reproduce your problem.
See, for example, the following macro with a few comments

Rene Brun

{
gROOT->Reset();
TFile f("hsimple.root");
TCanvas *c1 = new TCanvas("c1","c1",600,800);
TPad *pad = new TPad("planepad","This is pad",0,0,1,1);
pad->Divide(1,3); // it would be simpler to divide directly c1
pad->Draw(); // this line is not necessary
pad->cd(1);
hpx->Draw();
pad->cd(2);
hprof->Draw();
pad->cd(3);
hpxpy->Draw();
c1->Modified(); //not required
c1->Update(); //not required
}

Marek Idzik wrote:
>
> I do have problems when dividing and drawing the Tpad.
>
> With the cod like this:
> pad = new TPad("planepad","This is pad",0,0,1,1);
> pad->Divide(1,3);
> pad->Draw();
> /* here follow some lines with creation of histograms etc... */
> pad->cd(1); hpx2->SetFillColor(48); hpx2->Draw();
> pad->cd(2); hpx3->SetFillColor(48); hpx3->Draw();
> pad->cd(3); hpx4->SetFillColor(48); hpx4->Draw();
> Modified(); Update();
>
> When I need only one plot i.e. I use Canvas and plot
> the histogram without creation of pad, everything works well.
> On the contrary when I do need few plots and do it in the
> way shown above, as the result I get the Canvas not divided
> and with only one plot(in my case always the last I draw).
> In addition I get: *** Break *** segmentation violation
>
> Do I create or divide or use the Tpad in wrong way ?
>
> Thanks,
> marek