Re: [ROOT] Axis Range

From: Mikhail Jabitski (Zhabitsky) (Mikhail.Jabitski@cern.ch)
Date: Thu Mar 15 2001 - 08:52:49 MET


	Hi Michael!

Just change h1->GetXaxis to h1->GetXaxis().

	Mikhail


On Wed, 14 Mar 2001, Michael Kordosky wrote:

> Hi,
> 
> I am trying to set the axis range on a histogram with the following lines:
> 
> TFile* f = new TFile("mode-04-plots.root","READ");
> 
> TH1F* h1 = (TH1F*)f->Get("channel_0");
> 
> can->cd(4); //A divided TCanvas
> 
> h1->GetXaxis->SetRange(((h1->GetMaximumBin())-100),
> ((h1->GetMaximumBin())-400));
> h1->DrawCopy();
> 
> These lines produce the error message:
> 
> Error: Can't call
> TH1F::GetXaxis->SetRange(((h1->GetMaximumBin())-100),
> ((h1->GetMaximumBin())-400))
> in current scope FILE:mode-04-plots.C LINE:54
> Possible candidates are...
> filename       line:size busy function type and name  (in TH1F)
> filename       line:size busy function type and name  (in TH1)
> filename       line:size busy function type and name  (in TNamed)
> filename       line:size busy function type and name  (in TObject)
> filename       line:size busy function type and name  (in TAttLine)
> filename       line:size busy function type and name  (in TAttFill)
> filename       line:size busy function type and name  (in TAttMarker)
> filename       line:size busy function type and name  (in TArrayF)
> filename       line:size busy function type and name  (in TArray)
> *** Interpreter error recovered ***
> 
> Could someone point out what I am doing wrong?
> 
> Mike Kordosky
> 
> -- 
> Graduate Research Assistant  // High Energy Physics Lab
> kordosky@hep.utexas.edu     // University of Texas at Austin
> ph: (512) 471-8426 (RLM Lab, Office)
>     (512) 475-8673 (ENS Lab)
> 
> 



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