Getting the TAxis Module Labels

Hi All,

I have created a histogram and I want to edit the x axis. I want to edit the axis in such a way that the automatic tick labels generated when I use the Draw() function have an addition label e.g. If I had an axis from with tick labels are 0,1,2,3… they would instead read 0/0 1/7 2/14 3/21… I’m not sure if it’s possible but using the ChangeLabel() function in TGaxis I can edit them. However, I want to keep the information from the initial label e.g. 0,1,2,3… so that I can build the new axis labels. Is there a way to access the initial labels and return their value?

Cheers
Dom

Yes ChangeLabel is a possible way but it will change the entire label. You will need to include the initial label in the new label. The label optimization is done with THLimitsFinder::Optimize . You can use it to retrieve the initial label.

Hi,

Thanks for the Help! I’ve got exactly what I want.

Cheers
Dom

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.