More on TGraph Axis

From: Norbert Danneberg (norbert.danneberg@psi.ch)
Date: Fri Aug 13 1999 - 20:03:03 MEST


Hi,

its me again. Setting the axis range by hand in compiled
code only works if the canvas in which the TGraph is drawn
was updated before setting the axis range. 

This is part of the code :

  MuSRFourierCanv->cd();

  MuSRFitGraph->Draw("AP");

// commenting out the following line yields a
// NULL pointer to the axis. 

//MuSRFourierCanv->Update();   
  
  TAxis* GraphAxis = MuSRFitGraph->GetXaxis();
  cout << GraphAxis<<endl; 

  if(GraphAxis)
     GraphAxis->SetRange(GraphAxis->FindBin(-0.003),
                         GraphAxis->FindBin(0.003));

Moreover with this method the maximum and minimum of the 
axis can not be bigger than the values set by root since 
those bins do not exist in the histogram. (I am not shure
if I am right in thi point).


Peace & Freedom


Norbert



This archive was generated by hypermail 2b29 : Tue Jan 04 2000 - 00:43:38 MET