Histogram Title position

Hi,
I would like to display the title of a histogram just above the upper-right corner of the histogram frame instead of the upper-left one.
The only way I could find is to use the gStyle->SetTitleX(0.5); but this doesn’t work for all the title lenghts.
Could you give me some advise?
Many thanks
Stefania

gStyle->SetTitleAlign(33)
gStyle->SetTitleX(.99)