Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -69,9 +69,12 @@ if max_val > mean_val > min_val:
|
|
| 69 |
ax.axvline(mean_val, color='green', linestyle='--', linewidth=1)
|
| 70 |
ax.axvline(max_val, color='red', linestyle='--', linewidth=1)
|
| 71 |
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
|
|
|
|
|
|
|
|
|
| 75 |
|
| 76 |
ax.set_title(f"{kpi_selected} - Std. Deviation Curve")
|
| 77 |
ax.set_xlabel(f"{kpi_selected} ({unit})")
|
|
@@ -99,3 +102,4 @@ if max_val > mean_val > min_val:
|
|
| 99 |
)
|
| 100 |
else:
|
| 101 |
st.warning("Please ensure that: Min < Mean < Max to generate a valid bell curve.")
|
|
|
|
|
|
| 69 |
ax.axvline(mean_val, color='green', linestyle='--', linewidth=1)
|
| 70 |
ax.axvline(max_val, color='red', linestyle='--', linewidth=1)
|
| 71 |
|
| 72 |
+
# Adjusted label positions for visibility
|
| 73 |
+
y_max = y.max()
|
| 74 |
+
offset = y_max * 0.05
|
| 75 |
+
ax.text(min_val, offset, f'Min\n{min_val} {unit}', color='blue', ha='right', va='bottom')
|
| 76 |
+
ax.text(mean_val, mean_pdf + offset, f'Mean\n{mean_val} {unit}', color='green', ha='center', va='bottom')
|
| 77 |
+
ax.text(max_val, offset, f'Max\n{max_val} {unit}', color='red', ha='left', va='bottom')
|
| 78 |
|
| 79 |
ax.set_title(f"{kpi_selected} - Std. Deviation Curve")
|
| 80 |
ax.set_xlabel(f"{kpi_selected} ({unit})")
|
|
|
|
| 102 |
)
|
| 103 |
else:
|
| 104 |
st.warning("Please ensure that: Min < Mean < Max to generate a valid bell curve.")
|
| 105 |
+
|