Update visualization.py
Browse files- visualization.py +3 -3
visualization.py
CHANGED
@@ -53,8 +53,8 @@ class Visualization:
|
|
53 |
ax.text(bar.get_x() + bar.get_width() / 2, height, f'{height:.0f}%', ha='center', va='bottom', color='black')
|
54 |
|
55 |
# Highlight the range 80-89 for "Engagement Goal" and 90-100 for "Attendance Goal"
|
56 |
-
ax.fill_betweenx(y=[80, 89], x1=
|
57 |
-
ax.fill_betweenx(y=[90, 100], x1=
|
58 |
|
59 |
# Add horizontal lines for thresholds and averages
|
60 |
ax.axhline(y=90, color='#005288', linestyle=':', linewidth=1.5, label=f'Attendance Threshold: ≥ 90%')
|
@@ -63,7 +63,7 @@ class Visualization:
|
|
63 |
ax.axhline(y=engagement_avg_stats, color='#3AB0FF', linestyle='--', linewidth=1.5, label=f'Engagement Average: {engagement_avg_stats}%')
|
64 |
|
65 |
# Set the x-limits to ensure the fill covers the entire plot width
|
66 |
-
ax.set_xlim(left=
|
67 |
|
68 |
ax.set_xlabel('Student')
|
69 |
ax.set_ylabel('Percentage (%)')
|
|
|
53 |
ax.text(bar.get_x() + bar.get_width() / 2, height, f'{height:.0f}%', ha='center', va='bottom', color='black')
|
54 |
|
55 |
# Highlight the range 80-89 for "Engagement Goal" and 90-100 for "Attendance Goal"
|
56 |
+
ax.fill_betweenx(y=[80, 89], x1=x_min, x2=x_max, color='#3AB0FF', alpha=0.2, label='Engagement Goal')
|
57 |
+
ax.fill_betweenx(y=[90, 100], x1=x_min, x2=x_max, color='#005288', alpha=0.2, label='Attendance Goal')
|
58 |
|
59 |
# Add horizontal lines for thresholds and averages
|
60 |
ax.axhline(y=90, color='#005288', linestyle=':', linewidth=1.5, label=f'Attendance Threshold: ≥ 90%')
|
|
|
63 |
ax.axhline(y=engagement_avg_stats, color='#3AB0FF', linestyle='--', linewidth=1.5, label=f'Engagement Average: {engagement_avg_stats}%')
|
64 |
|
65 |
# Set the x-limits to ensure the fill covers the entire plot width
|
66 |
+
ax.set_xlim(left=x_min, right=x_max)
|
67 |
|
68 |
ax.set_xlabel('Student')
|
69 |
ax.set_ylabel('Percentage (%)')
|