Automatic Scaling of Axis Labels/Titles etc?

Hi all,

is there a way to automatically scale the labels and titles of the axes so that they do not overlap and are fully inside the canvas?

Cheers,

jndrf


_ROOT Version: 6.14.04
_Platform: SL6
Compiler: GCC 6.2


Some things are automatic but not all of them. Can you provide an example showing your problem ?

See attached. In the first one, the labels of the ratio plot overlap, in the secod one, titles of the y axis and the labels of the z axis are outside of the canvas.

PtForward_matched.pdf (18.6 KB)

Pt_AnyJet_central_reb_vs_reco.pdf (26.1 KB)

A wider Canvas sort of helps, but then it still cuts of the z axis labels.

AnyJetEtaDeviation_central_reco_vs_truth.pdf (16.1 KB)

I read large numbers of histograms from a file and print them, therefore I’d rather not tune everything by hand.

Sure. but you can set the default settings once using gStyle (and put that in your rootlogon.C). For instance you can change the margin to avoir the text goes out the picture.

But I still have to choose the margin size by hand. For some plots, the default is fine, for some it isn’t.

Is there really no function that automatically determines the needed size of the margin and/or scales the axis labels appropriately?

Not for the margins . Actually the Y title offset is automatic already. according to the length of the longest label. May be change it to none automatic (not 0).
https://root.cern/doc/master/classTStyle.html#a4968d6fdbc423a5eda0ee3db3b04ede7

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