Horizontal offset of x axis labels

{
   auto *canvas = new TCanvas("FpixBpixCanvas");
   auto *graph = new TGraph(1);
   canvas->SetBottomMargin(0.3);
   graph->Draw("0AP");
   graph->GetXaxis()->SetNdivisions(-525);
   graph->GetXaxis()->SetLabelOffset(0.005);
   graph->GetXaxis()->CenterTitle();
   graph->GetXaxis()->SetTitleOffset(3.1);

   for (int numBin=1;  numBin <= 26; numBin++)
      graph->GetXaxis()->ChangeLabel(numBin, 60, 0.02, 31, -1, -1,
                                     Form("ALongLabelMakesItObvious %d", numBin));
}

1 Like