Shivraj8615 commited on
Commit
987a502
·
verified ·
1 Parent(s): 3d3f1d9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -9
app.py CHANGED
@@ -65,16 +65,13 @@ if max_val > mean_val > min_val:
65
  ax.plot(x, y, color='royalblue', linewidth=2, label='Deviation Curve')
66
 
67
  # Markers for Min, Mean, Max
68
- ax.axvline(min_val, color='blue', linestyle='--', linewidth=1)
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})")
@@ -103,3 +100,4 @@ if max_val > mean_val > min_val:
103
  else:
104
  st.warning("Please ensure that: Min < Mean < Max to generate a valid bell curve.")
105
 
 
 
65
  ax.plot(x, y, color='royalblue', linewidth=2, label='Deviation Curve')
66
 
67
  # Markers for Min, Mean, Max
68
+ ax.plot(min_val, min_pdf, 'o', color='blue')
69
+ ax.plot(mean_val, mean_pdf, 'o', color='green')
70
+ ax.plot(max_val, max_pdf, 'o', color='red')
71
 
72
+ ax.annotate(f'{min_val} {unit}', (min_val, min_pdf), textcoords="offset points", xytext=(-10,10), ha='center', color='blue')
73
+ ax.annotate(f'{mean_val} {unit}', (mean_val, mean_pdf), textcoords="offset points", xytext=(0,10), ha='center', color='green')
74
+ ax.annotate(f'{max_val} {unit}', (max_val, max_pdf), textcoords="offset points", xytext=(10,10), ha='center', color='red')
 
 
 
75
 
76
  ax.set_title(f"{kpi_selected} - Std. Deviation Curve")
77
  ax.set_xlabel(f"{kpi_selected} ({unit})")
 
100
  else:
101
  st.warning("Please ensure that: Min < Mean < Max to generate a valid bell curve.")
102
 
103
+