Skip to content

Ratio plot first and last labels

This MR introduces one minor change to TQROOTPlotter and a not-as-minor change to TQDefaultPlotter

TQROOTPlotter: When creating new TCanvas object, the width and height does not correspond to those of the contained pad, but also includes the window decorations (File, Edit, ...). This means that one may be specifying a 800x600 = 4:3 aspect ratio with intent to have such proportions be respected on the output .pdf, but is not; the height is typically shorter than it is supposed to be. This is a one-liner fix, as stated in the TCanvas class reference, to add those margins back in, which enforces the pad to have exactly the width/height ratio as specified in the constructor.

TQDefaultPlotter: By default, erase the first and last label of the ratio axis such that the last label will never collide with the "0" of the main y-axis. The first label is just to make things symmetric. The labels can be turned back on (off by default) by:

style.ratio.firstLabel: true
style.ratio.lastLabel: true

Previously, where the user had to play around with ndivisions settings given the relevant ratio axis range to make sure the labels don't overlap, I personally think this is a saner & safer approach (one can do both for real fine-tuning). But as always, what works for my case never works 100% for others when it comes to plotting, so please leave feedback or thoughts...

Merge request reports