[ROOT] equally plotting area:

From: Aihong Tang (aihong@cnr.physics.kent.edu)
Date: Thu Sep 27 2001 - 20:18:15 MEST


Hi, rooters:

I wanna draw a few histograms together without margin between them,
following macro could allow me to do that, but the drawback is that the
plotting area in histograms with axis labels is smaller than that of
histogram without axis labels, since some area along the left and bottom
edge has to be left for labels/titles.

      ---------
      | 1 | 2 |    area 1,3,4 is smaller than area 2.
      ---------
      | 3 | 4 |
      ---------

Does anybody know a solution? 

Thanks!

Aihong
P.S. I am using ROOT 3.00.06

{
   gROOT->Reset();
   TCanvas c1("c1","multipads",700,900);
   gStyle->SetPadBorderMode(0);
   Float_t small = 1e-5;
   c1.Divide(2,2,small,small);
   TH2F h1("h1","test1",10,0,1,20,-1,1);
   TH2F h2("h2","test2",10,0,1,20,-1,1);
   TH2F h3("h3","test3",10,0,1,20,-1,1);
   TH2F h4("h4","test4",10,0,1,20,-1,1);

   c1.cd(1);
   gPad->SetBottomMargin(small);
   gPad->SetRightMargin(small);
   h1.Draw();

   c1.cd(2);
   gPad->SetBottomMargin(small);
   gPad->SetRightMargin(small);
   gPad->SetLeftMargin(small);
   h2.Draw();
   
   c1.cd(3);
   gPad->SetTopMargin(small);
   gPad->SetRightMargin(small);
   h3.Draw();

   c1.cd(4);
   gPad->SetTopMargin(small);
   gPad->SetRightMargin(small);
   gPad->SetLeftMargin(small);
   h4.Draw();
}      



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:00 MET