Label Offset

Dear root experts.

I am trying to draw a histogram with root, but the plot has an unexpected offset in x labels. I tried with SetLabelOffset but it didn’t work.

My code is:

can = TCanvas('can', '', 900,500)
can.cd()
histo.UseCurrentStyle()
histo.Draw()
histo.GetXaxis().SetLabelSize(0.02)
histo.SetLabelOffset(0.01,"x")
can.SetBorderMode(0)
can.SetBorderSize(0)
can.SetFillColor(kWhite)
can.SetBottomMargin(0.5)
can.SaveAs('histotemp.png')

and this is how it seems:
. I’m using pyroot.
Have any of you any idea of how to fix this?.
Thanks for your help.

It looks like your label text is left aligned, and you want it right aligned.

I don’t use pyROOT, but perhaps this will help:
root.cern.ch/root/html/TAttText.html

The labels are right align on the X axis. See:

$ROOTSYS/tutorials/hist/hlabels2.C