Change the angle of TAxis labels


I’m a newbie to the forums, but not so much to ROOT…

I’m trying to display a histogram (TH1) that has only 6 bins. Each of these bins has a name of about 8-10 characters. When the bin names are displayed on the horizontal axis, the fonts become kind of small.

So I thought I would change the angle of the labels to let’s say 45 or 90 degrees, maybe the whole thing would look better that way. I see that there is a possibility of changing the label angle through TGAxis, but TH1 doesn’t let me access the TGAxis that it uses to display the horizontal axis.

Is there a way to change the label angles in such a situation? I guess I could go all the way and hide the histogram’s own horizontal axis with my own, but that sounds to be quite a bit of work. Is there any way of doing this in a less painful way? Any suggestions are welcome.


see example in tutorials/hist/hlabels1.C, hlabels2.C and description of options
in TAxis::LabelOptions


Dear Rene,

Thanks, TAxis::LabelsOption() did what I had in mind.