https://github.com/root-project/root
Raw File
Tip revision: 1627b96bc05467cd958bf7dc1f8161ffc61f686a authored by Unknown Author on 06 February 2002, 11:51:08 UTC
This commit was manufactured by cvs2svn to create tag 'v3-01-05'.
Tip revision: 1627b96
zones.C
// example of script showing how to divide a canvas
// into adjacent subpads + axis labels on the top and right side
// of the pads.
{
   gROOT->Reset();
   TCanvas c1("c1","multipads",900,700);
   gStyle->SetPadBorderMode(0);
   gStyle->SetOptStat(0);
   c1.Divide(2,2,0,0);
   TH2F h1("h1","test1",10,0,1,20,0,20);
   TH2F h2("h2","test2",10,0,1,20,0,100);
   TH2F h3("h3","test3",10,0,1,20,-1,1);
   TH2F h4("h4","test4",10,0,1,20,0,1000);

   c1.cd(1);
   gPad->SetBottomMargin(0);
   gPad->SetRightMargin(0);
   gPad->SetTickx(2);
   h1.Draw();

   c1.cd(2);
   gPad->SetLeftMargin(0);
   gPad->SetBottomMargin(0);
   gPad->SetTickx(2);
   gPad->SetTicky(2);
   h2.GetYaxis()->SetLabelOffset(0.01);
   h2.Draw();
   
   c1.cd(3);
   gPad->SetTopMargin(0);
   gPad->SetRightMargin(0);
   h3.Draw();

   c1.cd(4);
   gPad->SetLeftMargin(0);
   gPad->SetTopMargin(0);
   gPad->SetTicky(2);
   h4.Draw();
}      
back to top