Update app.py
Browse files
app.py
CHANGED
|
@@ -340,7 +340,12 @@ def plot_intervention_statistics(intervention_stats):
|
|
| 340 |
ax.set_title('Intervention Sessions Held vs Not Held', fontsize=16) # Optional: Increased title font size
|
| 341 |
# Reverse the legend order to match the new stacking order
|
| 342 |
handles, labels = ax.get_legend_handles_labels()
|
| 343 |
-
ax.legend(handles[::-1], labels[::-1])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 344 |
st.pyplot(fig)
|
| 345 |
|
| 346 |
return fig
|
|
@@ -494,7 +499,7 @@ def plot_student_metrics(student_metrics_df, attendance_avg_stats, engagement_av
|
|
| 494 |
ax.set_title('Student Attendance and Engagement Metrics')
|
| 495 |
# ax.legend()
|
| 496 |
# ax.legend(loc='upper right', bbox_to_anchor=(1.25, 1), borderaxespad=0.)
|
| 497 |
-
ax.legend(loc='upper right',
|
| 498 |
ax.set_xticks(index) # Set x-ticks to the index
|
| 499 |
ax.set_xticklabels(student_metrics_df['Student'], rotation=0, ha='right') # Set student names as x-tick labels
|
| 500 |
# Set the y-axis limits and tick locations
|
|
|
|
| 340 |
ax.set_title('Intervention Sessions Held vs Not Held', fontsize=16) # Optional: Increased title font size
|
| 341 |
# Reverse the legend order to match the new stacking order
|
| 342 |
handles, labels = ax.get_legend_handles_labels()
|
| 343 |
+
ax.legend(handles[::-1], labels[::-1], frameon=False)
|
| 344 |
+
|
| 345 |
+
# Hide the top and right spines
|
| 346 |
+
ax.spines['top'].set_visible(False)
|
| 347 |
+
ax.spines['right'].set_visible(False)
|
| 348 |
+
|
| 349 |
st.pyplot(fig)
|
| 350 |
|
| 351 |
return fig
|
|
|
|
| 499 |
ax.set_title('Student Attendance and Engagement Metrics')
|
| 500 |
# ax.legend()
|
| 501 |
# ax.legend(loc='upper right', bbox_to_anchor=(1.25, 1), borderaxespad=0.)
|
| 502 |
+
ax.legend(loc='upper right', frameon=False)
|
| 503 |
ax.set_xticks(index) # Set x-ticks to the index
|
| 504 |
ax.set_xticklabels(student_metrics_df['Student'], rotation=0, ha='right') # Set student names as x-tick labels
|
| 505 |
# Set the y-axis limits and tick locations
|