Skip to content

Commit

Permalink
Merge pull request #41212 from ChuyuanLiu/fixTrkValPlot
Browse files Browse the repository at this point in the history
Fix axis title in tracking validation plots
  • Loading branch information
cmsbuild authored Mar 29, 2023
2 parents 75113f6 + 9819ad7 commit 72d0199
Showing 1 changed file with 2 additions and 24 deletions.
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

0 comments on commit 72d0199

Please sign in to comment.