Probably your limits are larger than the values in TGraph, and SetRangeUser cannot go “outside” those values. In that case, try with SetLimits instead (note that this is ok for TGraph, not so much for histograms). See
The viewing range for a histogram axis can be set from bin ifirst to ilast using the method TAxis::SetRange(ifirst, ilast). Example (hpxpy is a 2D histogram):
{
TFile f("hsimple.root");
hpxpy->Draw("colz");
hpxpy->GetYaxis()->SetRange(22,23);
hpxpy->GetXaxis()->SetRange(18,19);
}
Sometimes it is more convenient to set this range using “User’s Coordinates” (axis values) rather than bin numbers. To do that one should use TAxis::SetRangeUser(ufirst, ulast). This method computes the cl…
and
I have a th1d whose range is -10,10
but i want to plot -15,15
SetRangeUser(-15,15) draw the th1d for -10,10
any solution ?
ROOT Version: 6.24.00 (conda_forge)
Platform: ubuntu20.04 (wsl)
Compiler: gcc9