Skip to content

Commit

Permalink
Add data labels
Browse files Browse the repository at this point in the history
  • Loading branch information
nirs committed Feb 22, 2025
1 parent 68cf69e commit a88d55f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions bench
Original file line number Diff line number Diff line change
Expand Up @@ -395,6 +395,20 @@ def plot(data, config, args):
label=result["name"],
zorder=2,
)
for i, n in enumerate(y + offset):
if result["bitrates"][i] == 0:
continue
v = round(result["bitrates"][i], 1)
label = f"{v:.1f} "
plt.text(
result["bitrates"][i],
n,
label,
va="center",
ha="right",
color="white",
zorder=3,
)
offset += bar_width

ax.invert_yaxis()
Expand Down

0 comments on commit a88d55f

Please sign in to comment.