[ROOT] X and Y axis not handled consistently in TGraph.

From: Brett Viren (bv@bnl.gov)
Date: Mon Sep 09 2002 - 21:03:35 MEST


Hi,

I want to have control over the range of X and Y axis in a TGraph, but
attempts to change the Y range go ignored.  As an example:


// graph_test.C
TCanvas* canvas=0;
TGraph* graph = 0;
TAxis *ax=0, *ay=0;
void graph_test (void)
{
    graph = new TGraph();
    int i;
    for (i=0; i<10; ++i) {
        graph->SetPoint(i,i+0.5,i+0.5);
    }
    graph->Draw("A*");
    ax = graph->GetXaxis();
    ay = graph->GetYaxis();
    ax->SetRangeUser(2.0,4.0);
    ay->SetRangeUser(2.0,4.0);
    c1->Modified();
}
// end graph_test.C


Running this, only the X range is modified.  Is this a bug or a
feature?

If the latter, how can I modify the Y range (that is, from code not
interactively).

Thanks,
-Brett.



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