[ROOT] How to make bin area equal bin content?

From: sdean (sdean@hep.man.ac.uk)
Date: Thu Sep 16 2004 - 00:23:44 MEST


Hi ROOTers,

If I have a histogram with variable bin widths, how can I draw it so that 
the area of each bin is equal to the bin content? In other words, if my 
bin width is 5 and there is 1 entry, I want the bin height to be 0.2, not 
1. I can obviously do this with:

for (int i=1;i<nbins;++i){
  histo->SetBinContent(histo->GetBinContent(i)/histo->GetBinWidth(i));
}

but I was hoping there would be a draw option to make it easier.

Thanks for any help,

Simon



This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:09 MET