Skip to content

Commit

Permalink
truncate string per line
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-held committed Feb 3, 2025
1 parent 34aaac2 commit e28b2b1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/cabinetry/visualize/plot_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,11 @@ def data_mc(
ax2.set_xscale("log")

# figure label (region name)
label = "\n".join(
[f"{line[:30]}..." if len(line) > 30 else line for line in label.split("\n")]
)
at = mpl.offsetbox.AnchoredText(
f"{label[:30]}..." if len(label) > 30 else label,
label,
loc="upper left",
frameon=False,
prop={"fontsize": "large", "linespacing": 1.5},
Expand Down

0 comments on commit e28b2b1

Please sign in to comment.