From a3d79563791d4f313ca90bfefb63fc38736d4c5f Mon Sep 17 00:00:00 2001 From: Benkendorfer Date: Thu, 8 Aug 2024 00:02:09 +0200 Subject: [PATCH] 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. --- src/mplhep/label.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mplhep/label.py b/src/mplhep/label.py index fd5cbd6f..31036173 100644 --- a/src/mplhep/label.py +++ b/src/mplhep/label.py @@ -414,12 +414,18 @@ def exp_label( units="inches", fig=ax.figure, ) + + if com is not None: + _com_label = r"\mathrm{" + str(com) + r"\ TeV}" + else: + _com_label = r"\mathrm{13\ TeV}" + if lumi is not None: _lumi = ( - r"$\sqrt{s} = \mathrm{13\ TeV}, " + str(lumi) + r"\ \mathrm{fb}^{-1}$" + r"$\sqrt{s} = " + _com_label + ", " + str(lumi) + r"\ \mathrm{fb}^{-1}$" ) else: - _lumi = r"$\sqrt{s} = \mathrm{13\ TeV}$" + _lumi = r"$\sqrt{s} = " + _com_label + "$" explumi = ExpSuffix( *exptext.get_position(), text=rlabel if rlabel is not None else _lumi,