Re: [ROOT] Scale axis outside the data range

From: Rene Brun (Rene.Brun@cern.ch)
Date: Tue Apr 23 2002 - 08:46:11 MEST


Hi Steffen

An example

{
    const Int_t n=5;
    Float_t x[n] = {4.0, 5.0, 6.0, 7.0, 8.0};
    Float_t y[n] = {3.0, 3.4, 4.2, 4.6, 4.8};
    TGraph *gr1 = new TGraph(n,x,y);
    gr1->SetMarkerStyle(21);
    TCanvas *c1 = new TCanvas("c1");
    c1->DrawFrame(0,0,10,5);
    gr1->Draw("lp");
 }

Rene Brun

Steffen Grohmann wrote:
> 
>    Part 1.1       Type: Plain Text (text/plain)
>               Encoding: 7bit
Hello,

How can I set the axis range [xmin, xmax] in a graph outside the data range?
The SetRangeUser function only seems to work within the data range (e.g.
[4.0, 8.0] in the example below). If I want to fix the x-origin to "0" or
scale the x-axis to a range of e.g. [0,10] it doesn"t work.

SG

 Int_t n=5;
 Float_t x[n] = {4.0, 5.0, 6.0, 7.0, 8.0};
 Float_t y[n] = {3.0, 3.4, 4.2, 4.6, 4.8};
 TGraph *gr1 = new TGraph(n,x,y);



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:51 MET