Formatting tick labels in graph

Hi,

I’m trying to customise one of my plots making more room for an axis label by printing 40 (*10^3) instead of 40000 as the tick label, but I can’t find out what options to use/pass and to what functions. Please advise!

Not ideal: 54 Ideal: 07

Cheers,
Kim

Hi Kim,

does this work for you?

mygraph.GetYaxis()->SetLabelOffset(3); // 3 is a random value, pick the right one for yoru plot :)

Cheers,
D

Hi,

This solution is a good idea but has the problem of putting the label outside of the printable area of the plot :frowning:

Upon a reread of the post I realise it’s a bit difficult to discern what I am looking for! To clarify a bit more: I want to choose the prefix for the tick labels (e.g. 10^3) so that they take up less horizontal space.

Cheers,
Kim

Hi Kim,

did you have time to try the TCanvas::SetLeftMargin method?

Cheers,
D

May be try :

yaxis->SetMaxDigits(2);

Thats perfect @couet! Thanks!

Cheers,
Kim

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