Relabeling TGraph x-axis bins


I’m struggling with a TGraphAsymmErrors object; I want to relabel the x axis bins
to line up with the points in the graph, but they just don’t line up.

Here are the essentials:

void myfunc(const TVectorD& vx, const TVectorD& vy,
            const TVectorD& veyl, const TVectorD& veyh)
  TCanvas *c1 = new TCanvas("c1","c1",1200,300);
  TVectorD zerov(vx.GetNoElements()); // for x errors
  TGraphAsymmErrors *gr = new TGraphAsymmErrors(vx,vy,zerov,zerov,veyl,veyh);
  // source code for TGraphAsymmErrors constructor wants to define internal member "fNpoints"
  // like this: "fNpoints = TMath::Min(vx.GetNrows(), vy.GetNrows());"
  // so let's check:
  TAxis *xax = gr->GetXaxis();
  cout << vx.GetNrows() << endl;
  cout << vy.GetNrows() << endl;
  cout << xax->GetNbins() << endl;

This code puts out that (in my particular case) vx and vy have 84 rows, but the xaxis was
created with 100 bins, which I take to be the value of fMaxSize, another internal member
to the class. I also tried “xax->Set(84,0,83)”, “xax->Set(85,0,84)”, "xax->Set(86,0,85)"but I
could never quite get the labels to line up, presumably because other unaffected internal
members are still influencing the placement of labels on the graph.

To my shock, I checked the tutorials and also google, but I could find no example of
relabeling axes specifically for TGraphs and inherited classes! Can this possibly be the
first time this has come up? I’d more likely believe that I missed something essential

Thanks for any help,
-Phil D.

Can you provide a small running macro showing the problem ?