Re: [ROOT] histogram questions/comments

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Nov 02 2001 - 18:39:50 MET


Hi Kostas,

Kostas Oikonomou wrote:
> 
> I am a begining ROOT user, and I have a couple of comments on histograms:
> 
> 1. Is there a fundamental reason why setting the x-range on a histogram is done in
> terms of bins?  I find it much more convenient to work in terms of the real
> values that are displayed on the x-axis.
> 

Several reasons for this. First of all, it makes no sense after filling
to draw a fractional part of a bin. You have lost the information at this point.
When using the graphical interface (may be you did not read the documentation
yet)
you can zoom/unzoom on any axis. When clicking with the mouse on the start point
and releasing the mouse on the end point, Root will calculate the low-edge
and upper-edge respectively of the first and last bin.
>From C++, you can do
  TAxis *axis = hist->GetXaxis(); // same for y axis
  axis->SetRange(axis->FindBin(xmin), axis->FindBin(xmax));


> 2. Would it be possible to allow rebinning a histogram interactively, i.e. from
> a pulldown menu?  By rebinning I mean changing the number of x-bins.

The TH1::Rebin function is available in the context menu in the development
version in CVS.

Rene Brun



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