Multiple canvas

Hello All

For various reasons, I do not want to divide a canvas to pads and instead want to open 3 different canvas. How do I set which is the active canvas?

I tried this and it would not work. It plotted all the histograms on the c3 canvas.

[code]TCanvas *c1 = new TCanvas(“c1”,“Axial Sensitivity 22mm”,200,10,800,600);
TCanvas *c2 = new TCanvas(“c2”,“Axial Sensitivity 20mm”,200,10,800,600);
TCanvas *c3 = new TCanvas(“c3”,“Axial Sensitivity 18mm”,200,10,800,600);

c1->Update();
AS2244->SetFillColor(1);AS2244->SetMarkerStyle(23); AS2244->SetMarkerColor(1);AS2244->Draw();
AS2242->SetFillColor(4);AS2242->SetMarkerStyle(23); AS2242->SetMarkerColor(1);AS2242->Draw(“same”);

c2->Update();
AS2044->SetFillColor(2);AS2044->SetMarkerStyle(22); AS2044->SetMarkerColor(2);AS2044->Draw();
AS2042->SetFillColor(5);AS2042->SetMarkerStyle(22); AS2042->SetMarkerColor(2);AS2042->Draw(“same”);

c3->Update();
AS1844->SetFillColor(3);AS1844->SetMarkerStyle(21); AS1844->SetMarkerColor(3);AS1844->Draw();
AS1842->SetFillColor(6);AS1842->SetMarkerStyle(21); AS1842->SetMarkerColor(3);AS1842->Draw(“same”);[/code]

Thanks.

c1->cd();
c2->cd();

Rene

I want to plot a function in many different canvases at the same time. Here is what i did:

{
  TF1 f1("func","sin(x)",0,10);
  TCanvas *c=new TCanvas ("c","Test Canvas",1);
  c->Divide(2,2);
  for(Int_t i=0,i<3,i++){
    c->cd(i);
    f1->Draw();
  }
}

Why is it not working?

Your loop is wrong it should be:

  for(Int_t i=1,i<=4,i++){