Re: scaling a histogram

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Feb 18 2000 - 09:48:19 MET


Hi Manuel,
This is the intended behaviour with log scales. In case of histograms
with
empty bins, one has to use an algorithm to find the minimum scale.
We use the following algorithm:
 - default is to draw 3 log decades
 - In the (by far) most frequent case of histograms, show as many
decades
   such as bins with contents >= 1 are always shown.

In your particular example, 3 decades are shown.
You can call hpx->SetMinimum(1e-4) if you like

Rene Brun
 
Manuel Calderon de la Barca Sanchez wrote:
> 
> Hello roottalk,
> 
> I had a problem when rescaling a histogram in log scale.  It seems that
> for some choice of scale, the lower bound of the y axis is not rescaled
> correctly, leaving parts of the histogram out of sight.  To reproduce, run
> the macro below using the hsimple.root file in the tutorials.
> 
> Thanks,
> 
> Manuel.
> 
> -------
> {
>  TFile f("hsimple.root");
>  hpx->Draw();
>  gPad->Update();
>  gPad->SetLogy();
>  gPad->Modified();
>  gPad->Update();
>  TCanvas c2("c2","wrong log scale", 200,200,600,400);
>  hpx->Draw();
>  gPad->SetLogy();
>  hpx->Scale(0.025);
>  gPad->Modified();
>  gPad->Update();
> }



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