Skip to content

Commit

Permalink
fix: modified tick labels to read mpl ticks labels not positions
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejnovak committed May 2, 2024
1 parent f6c9542 commit 59a318e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/mplhep/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,7 @@ def iterable_not_string(arg):
)

elif flow == "show" and (underflow > 0.0 or overflow > 0.0):
xticks = ax.get_xticks().tolist()
xticks = [label.get_text() for label in ax.get_xticklabels()]
lw = ax.spines["bottom"].get_linewidth()
_edges = plottables[0].edges
_centers = plottables[0].centers
Expand All @@ -556,6 +556,7 @@ def iterable_not_string(arg):
if underflow > 0.0:
xticks[0] = ""
xticks[1] = f"<{flow_bins[2]}"
ax.set_xticks(ax.get_xticks())
ax.set_xticklabels(xticks)

ax.plot(
Expand All @@ -582,6 +583,7 @@ def iterable_not_string(arg):
if overflow > 0.0:
xticks[-1] = ""
xticks[-2] = f">{flow_bins[-3]}"
ax.set_xticks(ax.get_xticks())
ax.set_xticklabels(xticks)
ax.plot(
[_edges[-2], _edges[-1]],
Expand Down

0 comments on commit 59a318e

Please sign in to comment.