Question on Sub-pads

Hi,

I have a slight problem with subpads on ROOT. I execute a script as the following and i take a plot

TCanvas can2 = new TCanvas(“can2”,“three parameter fit”,1);
TGraphErrors res2 = new TGraphErrors(n,beamenergy,resolution,0,error);
TF1 fpar3 = new TF1(“par3”,"sqrt([0][0]+([1]/sqrt(x))
([1]/sqrt(x))+([2]/x)
([2]/x))");
res2->SetTitle(“xxx”);
res2->GetXaxis()->SetTitle(“Beam Energy (GeV)”);
res2->GetYaxis()->SetTitle(“Resolution”);
can2->cd();
res2->Draw(“AP”);
res2->SetMarkerStyle(21);
res2->SetMarkerColor(2);
res2->Fit(“par3”);

I would like to have in the same Canvas e.x. 3 different plots, but unfortunatelly I can do it! Any suggestins are welcome…

Thanx,
Loukas

Could you explain precisely what you want to do?
see option “same” in TH1::Draw

Rene

I have made a few scripts like the one I sent and when I execute them a graph is ploted.
I would like to divide a canvas in 3 pads and on each pad plot a graph. I am not quite sure which comands I should write on my script to do this.

Thanx,
Loukas

Use TPad::Divide. See the first pages of teh Users Guide and
see examples in the tutorials, eg h1draw.C

Rene

I manage to do it thanks to your suggestions.

Thank you,
Loukas