lichih commited on
Commit
20aeaf0
·
verified ·
1 Parent(s): 4cbcc7c

update chart text

Browse files
Files changed (1) hide show
  1. app.py +3 -4
app.py CHANGED
@@ -61,12 +61,11 @@ def draw_bar_chart(data: dict[str, list[str | float]]):
61
  fig, ax = plt.subplots(figsize=(8, 6))
62
  ax.bar(classes, probabilities, color="skyblue")
63
 
64
- ax.set_xlabel("Class")
65
- ax.set_ylabel("Probability (%)")
66
- ax.set_title("Class Probabilities")
67
 
68
  for i, prob in enumerate(probabilities):
69
- ax.text(i, prob + 0.01, f"{prob:.2f}", ha="center", va="bottom")
70
 
71
  fig.tight_layout()
72
 
 
61
  fig, ax = plt.subplots(figsize=(8, 6))
62
  ax.bar(classes, probabilities, color="skyblue")
63
 
64
+ ax.set_xlabel("類別")
65
+ ax.set_ylabel("機率 (%)")
 
66
 
67
  for i, prob in enumerate(probabilities):
68
+ ax.text(i, prob + 0.01, f"{prob:.2f}%", ha="center", va="bottom")
69
 
70
  fig.tight_layout()
71