I am new to root. I can plot two TGraphErrors on the same axes with the code below and set the range of the x-axis with the gr1->GetXaxis()->SetLimits( 3660, 3700); statement. But when I try to do the same thing for the y-axis nothing happens, although I don’t get an error message, the axis keeps the same range displayed. Can someone tell me how I can set the y-axis range?
TGraphErrors* gr1 = new TGraphErrors(n, cm_energyMeV, scaled_xsec, 0, scaled_xerr);
gr1->SetTitle("Cross-Section at the #psi '");
gr1->Draw("AP");
TGraphErrors* gr2 = new TGraphErrors(j, nk_cm_energyMeV, nk_scaled_xsec, 0, nk_scaled_xerr);
gr2->SetTitle("Cross-Section at the #psi '");
gr2->Draw("P");
c3->Update();
gr1->GetXaxis()->SetLimits( 3660, 3700);
gr1->GetYaxis()->SetLimits( 0, 1900);
gr1->Draw("AP");
gr2->Draw("P");
c3->Update();
I can reproduce this with 2 TH2Fs in one Canvas (one pad each), rightclicking on the yaxis, SetRangeUser - and nothing happens. 1FH2F per canvas works just fine. CVS version from last week, linux build=debug.
Axel.
SetRangeUser and SetLimits can not zoom Yaxis of TGraph as
shown in an attached eps file that is obtained by
the sample code at the following condition:
Root Version 4.00/06 11 August 2004
CINT/ROOT C/C++ Interpreter version 5.15.138, May 23 2004
Linux version 2.4.19-0vl11
gcc version 2.95.3
I will select data-points for SetPoint() by myself until
your symmetry axis X-Y version.
Adding selection codes may be easy to user, however your new
version will increase functionality of TGraph in
browsing and data selection.