Re: TGarph Axes Ranges

From: Rene Brun (Rene.Brun@cern.ch)
Date: Mon Aug 16 1999 - 08:35:38 MEST


Hi Norbert,
To set the pad range and draw the corresponding axis, use
TPad::DrawFrame.
See an example in $ROOTSYS/tutorials/gerrors2.C (version 2.22/10)

Rene Brun

Norbert Danneberg wrote:
> 
> Hi,
> 
> I am trying to set the X and Y axses-ranges of a TGraph
> by hand. I found the following solution:
> 
> MuSRFitGraph->GetYaxis()->SetRange(MuSRFitGraph->GetYaxis()->FindBin(-0.004),MuSRFitGraph->GetYaxis()->FindBin(0.004))
> 
> which seams rather strange and complicated to me.
> 
> I am wondering if somebody knows an easier way to do it.
> Moreove ist does not work for the Y-Axis. For the Y Asxis
> I use
> 
> MuSRFitGraph->SetMaximum(0.004);
> MuSRFitGraph->SetMinimum(-0.004);
> 
> I guess the reason for this is, that histograms are used
> to draw TGraphs. Why should Y and X Axes of a graph
> be different ??
> 
> I guess implementing to four new memberfunctions like
> SetXMin() SetXMax() SetYMin() SetYMax() for TGraph is probably
> straightforward.
> 
> Peace
> 
> norbert



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