Skip to content

Commit a3d7956

Browse files
authored
Make left label read COM energy (#510)
Previously, only right-side experimental labels actually read the COM energy. This commit makes the left-side labels do the same. The default remains at 13 TeV if no COM energy is supplied.
1 parent 09c27ce commit a3d7956

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/mplhep/label.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -414,12 +414,18 @@ def exp_label(
414414
units="inches",
415415
fig=ax.figure,
416416
)
417+
418+
if com is not None:
419+
_com_label = r"\mathrm{" + str(com) + r"\ TeV}"
420+
else:
421+
_com_label = r"\mathrm{13\ TeV}"
422+
417423
if lumi is not None:
418424
_lumi = (
419-
r"$\sqrt{s} = \mathrm{13\ TeV}, " + str(lumi) + r"\ \mathrm{fb}^{-1}$"
425+
r"$\sqrt{s} = " + _com_label + ", " + str(lumi) + r"\ \mathrm{fb}^{-1}$"
420426
)
421427
else:
422-
_lumi = r"$\sqrt{s} = \mathrm{13\ TeV}$"
428+
_lumi = r"$\sqrt{s} = " + _com_label + "$"
423429
explumi = ExpSuffix(
424430
*exptext.get_position(),
425431
text=rlabel if rlabel is not None else _lumi,

0 commit comments

Comments
 (0)