Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -269,7 +269,7 @@ def run_arabic():
|
|
269 |
# إنشاء الرسم البياني
|
270 |
st.subheader("رسم توزيع الدرجات")
|
271 |
unique_values, counts = np.unique(notes_result, return_counts=True)
|
272 |
-
plt.figure(figsize=(10, 6))
|
273 |
bars = plt.bar(unique_values, counts, width=0.3)
|
274 |
plt.axvline(x=average_x, color='red', linestyle='--')
|
275 |
plt.text(average_x + 1.5, max(counts), 'متوسط الدرجات', color='red', rotation=0, ha='center', va='bottom')
|
@@ -317,12 +317,15 @@ def run_arabic():
|
|
317 |
va="top",
|
318 |
transform=plt.gca().transAxes # Koordinatları grafiğe göre ayarla
|
319 |
)
|
|
|
|
|
|
|
320 |
# عرض الرسم البياني
|
321 |
st.pyplot(plt)
|
322 |
|
323 |
# زر لتحميل الرسم البياني
|
324 |
buf = BytesIO()
|
325 |
-
plt.savefig(buf, format="png")
|
326 |
buf.seek(0)
|
327 |
st.download_button(
|
328 |
label="تحميل الرسم البياني",
|
@@ -439,7 +442,7 @@ def run_english():
|
|
439 |
# Create plot
|
440 |
st.subheader("Score Distribution Graph")
|
441 |
unique_values, counts = np.unique(notes_result, return_counts=True)
|
442 |
-
plt.figure(figsize=(10, 6))
|
443 |
bars = plt.bar(unique_values, counts, width=0.3)
|
444 |
plt.axvline(x=average_x, color='red', linestyle='--')
|
445 |
plt.text(average_x + 1.5, max(counts), 'Average Score', color='red', rotation=0, ha='center', va='bottom')
|
@@ -488,12 +491,14 @@ def run_english():
|
|
488 |
transform=plt.gca().transAxes # Koordinatları grafiğe göre ayarla
|
489 |
)
|
490 |
|
|
|
|
|
491 |
# Display the plot
|
492 |
st.pyplot(plt)
|
493 |
|
494 |
# Download button for the plot
|
495 |
buf = BytesIO()
|
496 |
-
plt.savefig(buf, format="png")
|
497 |
buf.seek(0)
|
498 |
st.download_button(
|
499 |
label="Download Graph",
|
|
|
269 |
# إنشاء الرسم البياني
|
270 |
st.subheader("رسم توزيع الدرجات")
|
271 |
unique_values, counts = np.unique(notes_result, return_counts=True)
|
272 |
+
plt.figure(figsize=(10, 6),dpi=150)
|
273 |
bars = plt.bar(unique_values, counts, width=0.3)
|
274 |
plt.axvline(x=average_x, color='red', linestyle='--')
|
275 |
plt.text(average_x + 1.5, max(counts), 'متوسط الدرجات', color='red', rotation=0, ha='center', va='bottom')
|
|
|
317 |
va="top",
|
318 |
transform=plt.gca().transAxes # Koordinatları grafiğe göre ayarla
|
319 |
)
|
320 |
+
|
321 |
+
plt.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9)
|
322 |
+
|
323 |
# عرض الرسم البياني
|
324 |
st.pyplot(plt)
|
325 |
|
326 |
# زر لتحميل الرسم البياني
|
327 |
buf = BytesIO()
|
328 |
+
plt.savefig(buf, format="png",bbox_inches='tight')
|
329 |
buf.seek(0)
|
330 |
st.download_button(
|
331 |
label="تحميل الرسم البياني",
|
|
|
442 |
# Create plot
|
443 |
st.subheader("Score Distribution Graph")
|
444 |
unique_values, counts = np.unique(notes_result, return_counts=True)
|
445 |
+
plt.figure(figsize=(10, 6),dpi=150)
|
446 |
bars = plt.bar(unique_values, counts, width=0.3)
|
447 |
plt.axvline(x=average_x, color='red', linestyle='--')
|
448 |
plt.text(average_x + 1.5, max(counts), 'Average Score', color='red', rotation=0, ha='center', va='bottom')
|
|
|
491 |
transform=plt.gca().transAxes # Koordinatları grafiğe göre ayarla
|
492 |
)
|
493 |
|
494 |
+
plt.subplots_adjust(left=0.1, bottom=0.1, right=0.9, top=0.9)
|
495 |
+
|
496 |
# Display the plot
|
497 |
st.pyplot(plt)
|
498 |
|
499 |
# Download button for the plot
|
500 |
buf = BytesIO()
|
501 |
+
plt.savefig(buf, format="png",bbox_inches='tight')
|
502 |
buf.seek(0)
|
503 |
st.download_button(
|
504 |
label="Download Graph",
|