Spaces:
Running
Running
Yuxuan-Zhang-Dexter
commited on
Commit
·
6d7b424
1
Parent(s):
90adead
update font
Browse files- app.py +2 -2
- data_visualization.py +8 -10
app.py
CHANGED
@@ -585,8 +585,8 @@ def build_app():
|
|
585 |
with gr.Blocks(css="""
|
586 |
.visualization-container {
|
587 |
height: 70vh !important; /* Reduced from 85vh to 70vh */
|
588 |
-
max-height:
|
589 |
-
min-height:
|
590 |
background-color: #f8f9fa;
|
591 |
border-radius: 10px;
|
592 |
padding: 20px; /* Reduced padding from 25px to 20px */
|
|
|
585 |
with gr.Blocks(css="""
|
586 |
.visualization-container {
|
587 |
height: 70vh !important; /* Reduced from 85vh to 70vh */
|
588 |
+
max-height: 600px !important; /* Reduced from 900px to 700px */
|
589 |
+
min-height: 400px !important; /* Reduced from 600px to 500px */
|
590 |
background-color: #f8f9fa;
|
591 |
border-radius: 10px;
|
592 |
padding: 20px; /* Reduced padding from 25px to 20px */
|
data_visualization.py
CHANGED
@@ -496,8 +496,8 @@ def create_group_bar_chart(df):
|
|
496 |
ax.set_xticks(np.arange(n_games))
|
497 |
ax.set_xticklabels(active_games, rotation=45, ha='right', fontsize=10)
|
498 |
ax.set_ylabel('Normalized Performance Score', fontsize=12)
|
499 |
-
ax.set_title('AI Model Performance
|
500 |
-
fontsize=14, pad=20)
|
501 |
|
502 |
# Add grid lines
|
503 |
ax.grid(True, axis='y', linestyle='--', alpha=0.3)
|
@@ -523,11 +523,11 @@ def create_group_bar_chart(df):
|
|
523 |
sorted_labels = [model for model in model_order if model in by_label]
|
524 |
|
525 |
ax.legend(sorted_handles, sorted_labels,
|
526 |
-
bbox_to_anchor=(1.00, 1),
|
527 |
loc='upper left',
|
528 |
fontsize=9,
|
529 |
title='AI Models',
|
530 |
-
title_fontsize=10)
|
531 |
|
532 |
# No need for tight_layout() as we're manually controlling the spacing
|
533 |
|
@@ -686,7 +686,7 @@ def create_single_radar_chart(df, selected_games=None, highlight_models=None):
|
|
686 |
ax.fill(angles, values, alpha=0.25, color='red')
|
687 |
|
688 |
# Add title
|
689 |
-
plt.title('AI Models Performance Across
|
690 |
pad=20, fontsize=14, fontweight='bold')
|
691 |
|
692 |
# Get handles and labels for legend
|
@@ -713,13 +713,10 @@ def create_single_radar_chart(df, selected_games=None, highlight_models=None):
|
|
713 |
# Add legend with reordered handles and labels
|
714 |
legend = plt.legend(handles, labels,
|
715 |
loc='center left',
|
716 |
-
bbox_to_anchor=(0.95, 1),
|
717 |
fontsize=8,
|
718 |
title='AI Models',
|
719 |
-
title_fontsize=10)
|
720 |
-
|
721 |
-
# Make the legend title bold
|
722 |
-
legend.get_title().set_fontweight('bold')
|
723 |
|
724 |
# Adjust layout to prevent label cutoff
|
725 |
plt.subplots_adjust(right=0.8) # Added subplot adjustment to give more space on the right
|
@@ -750,3 +747,4 @@ def save_visualization(fig, filename):
|
|
750 |
Save visualization to file
|
751 |
"""
|
752 |
fig.savefig(filename, bbox_inches='tight', dpi=300)
|
|
|
|
496 |
ax.set_xticks(np.arange(n_games))
|
497 |
ax.set_xticklabels(active_games, rotation=45, ha='right', fontsize=10)
|
498 |
ax.set_ylabel('Normalized Performance Score', fontsize=12)
|
499 |
+
ax.set_title('AI Model Performance Across Games',
|
500 |
+
fontsize=14, pad=20, fontweight='bold')
|
501 |
|
502 |
# Add grid lines
|
503 |
ax.grid(True, axis='y', linestyle='--', alpha=0.3)
|
|
|
523 |
sorted_labels = [model for model in model_order if model in by_label]
|
524 |
|
525 |
ax.legend(sorted_handles, sorted_labels,
|
526 |
+
bbox_to_anchor=(1.00, 1),
|
527 |
loc='upper left',
|
528 |
fontsize=9,
|
529 |
title='AI Models',
|
530 |
+
title_fontsize=10) # Added bold font weight for model names
|
531 |
|
532 |
# No need for tight_layout() as we're manually controlling the spacing
|
533 |
|
|
|
686 |
ax.fill(angles, values, alpha=0.25, color='red')
|
687 |
|
688 |
# Add title
|
689 |
+
plt.title('AI Models Performance Across Games\n(Normalized Scores)',
|
690 |
pad=20, fontsize=14, fontweight='bold')
|
691 |
|
692 |
# Get handles and labels for legend
|
|
|
713 |
# Add legend with reordered handles and labels
|
714 |
legend = plt.legend(handles, labels,
|
715 |
loc='center left',
|
716 |
+
bbox_to_anchor=(0.95, 1),
|
717 |
fontsize=8,
|
718 |
title='AI Models',
|
719 |
+
title_fontsize=10) # Added bold font weight for model names
|
|
|
|
|
|
|
720 |
|
721 |
# Adjust layout to prevent label cutoff
|
722 |
plt.subplots_adjust(right=0.8) # Added subplot adjustment to give more space on the right
|
|
|
747 |
Save visualization to file
|
748 |
"""
|
749 |
fig.savefig(filename, bbox_inches='tight', dpi=300)
|
750 |
+
|