Re: [ROOT] Histogram frames wrt pad

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Jul 07 2000 - 22:13:51 MEST


Hi Marc
A few days ago, I posted the following example to this list:

Rene Brun

{
   gROOT->Reset();
   TCanvas c1("c1","multipads",700,700);
   gStyle->SetPadBorderMode(0);
   gStyle->SetFrameBorderMode(0);
   Float_t small = 1e-5;
   c1.Divide(2,2,small,small);
   TH1F h1("h1","test1",40,-4,4);
   TH1F h2("h2","test2",40,-4,4);
   TH1F h3("h3","test3",40,-4,4);
   TH1F h4("h4","test4",40,-4,4);
   h1.FillRandom("gaus",1000);
   h2.FillRandom("gaus",1000);
   h3.FillRandom("gaus",1000);
   h4.FillRandom("gaus",1000);
   
   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);
   gPad->SetTickx();
   h3.Draw();

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


On Fri, 7 Jul 2000 KAMPS@fsw.leidenuniv.nl wrote:

> 
> Hi,
> A few days ago I asked how u can control where a histogram frame lands inside
> a pad and I was referred to the Set*Margin methods of TPadAtt or similar
> functions in TStyle. This works reasonably well, but in this case I want
> a large number of histograms drawn without any whitespace between them.
> 
> 
> I have put the margin values to very small values and indeed the histograms
> become larger in the pad. Interestingly, putting them to exactly zero seems
> to reproduce the default values, but I do not succeed in letting the histo
> frames coincide with the pad boundary( give or take a pixel). I guess that
> is because there is more to the histogram than the frame, like axis labels
> etc.
> 
> What would be the optimal way to produce a large number of histograms without
> any white space between them ?
> Thanks,
> 	Marc
> 



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:29 MET