Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix axis title in tracking validation plots #41212

Merged
merged 2 commits into from
Mar 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 2 additions & 24 deletions Validation/RecoTrack/python/plotting/plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1243,16 +1243,7 @@ def __init__(self, pad, bounds, zmax, nrows, xbinlabels=None, xbinlabelsize=None
self._frame = _drawFrame(pad, bounds, zmax, xbinlabels, xbinlabelsize, xbinlabeloption, ybinlabels)

yoffsetFactor = 1
xoffsetFactor = 1
if nrows == 2:
yoffsetFactor *= 2
xoffsetFactor *= 2
elif nrows >= 5:
yoffsetFactor *= 1.5
xoffsetFactor *= 1.5
elif nrows >= 3:
yoffsetFactor *= 4
xoffsetFactor *= 3
xoffsetFactor = 0

self._frame.GetYaxis().SetTitleOffset(self._frame.GetYaxis().GetTitleOffset()*yoffsetFactor)
self._frame.GetXaxis().SetTitleOffset(self._frame.GetXaxis().GetTitleOffset()*xoffsetFactor)
Expand Down Expand Up @@ -1325,20 +1316,7 @@ def __init__(self, pad, bounds, zmax, ratioBounds, ratioFactor, nrows, xbinlabel
self._frame.GetXaxis().SetTitleSize(0)

yoffsetFactor = ratioFactor
divisionPoint = 1-1/ratioFactor
xoffsetFactor = 1/divisionPoint #* 0.6

if nrows == 1:
xoffsetFactor *= 0.6
elif nrows == 2:
yoffsetFactor *= 2
xoffsetFactor *= 1.5
elif nrows == 3:
yoffsetFactor *= 4
xoffsetFactor *= 2.3
elif nrows >= 4:
yoffsetFactor *= 5
xoffsetFactor *= 3
xoffsetFactor = 0

self._frame.GetYaxis().SetTitleOffset(self._frameRatio.GetYaxis().GetTitleOffset()*yoffsetFactor)
self._frameRatio.GetYaxis().SetLabelSize(int(self._frameRatio.GetYaxis().GetLabelSize()*0.8))
Expand Down