Skip to content

Commit

Permalink
Update label.py
Browse files Browse the repository at this point in the history
Correctly format com and lumi
  • Loading branch information
ruelasvh authored Jul 13, 2023
1 parent 9894bcb commit 060cfa1
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions src/mplhep/label.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,18 @@ def exp_label(
fig=ax.figure,
)
if lumi is not None:
_lumi = (
r"$\sqrt{s} = \mathrm{"
+ lumi_format.format(lumi)
+ r"\ TeV}, "
+ str(lumi)
+ r"\ \mathrm{fb}^{-1}$"
_lumi = r"{com}, {lumi}".format(
com=r"$\sqrt{s} = \mathrm{" + str(com) + r"\ TeV}$"
if com is not None
else r"$\sqrt{s} = \mathrm{13\ TeV}$",
lumi=lumi_format.format(lumi) + r" $\mathrm{fb^{-1}}$",
)
else:
_lumi = ""
_lumi = r"{com}".format(
com=r"$\sqrt{s} = \mathrm{" + str(com) + r"\ TeV}$"
if com is not None
else r"$\sqrt{s} = \mathrm{13\ TeV}$",
)
explumi = ExpSuffix(
*exptext.get_position(),
text=rlabel if rlabel is not None else _lumi,
Expand Down

0 comments on commit 060cfa1

Please sign in to comment.