Spaces:
Build error
Build error
Update src/streamlit_app.py
Browse files- src/streamlit_app.py +16 -8
src/streamlit_app.py
CHANGED
|
@@ -16,7 +16,7 @@ def setup_korean_font():
|
|
| 16 |
try:
|
| 17 |
# 1. ์ฌ์ฉ์ ํฐํธ ํ์ผ ํ์ธ
|
| 18 |
script_dir = os.path.dirname(os.path.abspath(__file__))
|
| 19 |
-
possible_fonts = ["
|
| 20 |
|
| 21 |
font_path = None
|
| 22 |
for font_file in possible_fonts:
|
|
@@ -97,6 +97,12 @@ def analyze_scores(df):
|
|
| 97 |
st.write("#### ๐จ ์ ์ ๋ถํฌ ์๊ฐํ")
|
| 98 |
|
| 99 |
try:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 100 |
fig, ax = plt.subplots(figsize=(12, 7))
|
| 101 |
|
| 102 |
# ํ์คํ ๊ทธ๋จ๊ณผ KDE ๊ณก์
|
|
@@ -111,17 +117,19 @@ def analyze_scores(df):
|
|
| 111 |
# ํ๊ท ์
|
| 112 |
ax.axvline(mu, color='red', linestyle=':', linewidth=2, alpha=0.8, label=f'ํ๊ท : {mu:.1f}')
|
| 113 |
|
| 114 |
-
# ์ ๋ชฉ๊ณผ ๋ผ๋ฒจ - ํ๊ธ
|
| 115 |
-
ax.set_title(f'{score_column} ์ ์ ๋ถํฌ ๋ถ์', fontsize=16, pad=20)
|
| 116 |
-
ax.set_xlabel('์ ์', fontsize=12)
|
| 117 |
-
ax.set_ylabel('๋ฐ๋', fontsize=12)
|
| 118 |
-
|
|
|
|
|
|
|
| 119 |
ax.grid(True, alpha=0.3)
|
| 120 |
|
| 121 |
-
# ํต๊ณ ์ ๋ณด ๋ฐ์ค
|
| 122 |
stats_text = f'์ํ ์: {len(scores)}\nํ๊ท : {mu:.2f}\nํ์คํธ์ฐจ: {std:.2f}\n์ต์๊ฐ: {scores.min():.1f}\n์ต๋๊ฐ: {scores.max():.1f}'
|
| 123 |
ax.text(0.02, 0.98, stats_text, transform=ax.transAxes,
|
| 124 |
-
fontsize=10, verticalalignment='top',
|
| 125 |
bbox=dict(boxstyle='round,pad=0.5', facecolor='lightblue', alpha=0.8))
|
| 126 |
|
| 127 |
plt.tight_layout()
|
|
|
|
| 16 |
try:
|
| 17 |
# 1. ์ฌ์ฉ์ ํฐํธ ํ์ผ ํ์ธ
|
| 18 |
script_dir = os.path.dirname(os.path.abspath(__file__))
|
| 19 |
+
possible_fonts = ["NanumGothic.ttf"]
|
| 20 |
|
| 21 |
font_path = None
|
| 22 |
for font_file in possible_fonts:
|
|
|
|
| 97 |
st.write("#### ๐จ ์ ์ ๋ถํฌ ์๊ฐํ")
|
| 98 |
|
| 99 |
try:
|
| 100 |
+
# ํ๊ธ ํฐํธ ์ค๋น
|
| 101 |
+
if FONT_PATH:
|
| 102 |
+
font_prop = fm.FontProperties(fname=FONT_PATH)
|
| 103 |
+
else:
|
| 104 |
+
font_prop = fm.FontProperties(family=plt.rcParams['font.family'])
|
| 105 |
+
|
| 106 |
fig, ax = plt.subplots(figsize=(12, 7))
|
| 107 |
|
| 108 |
# ํ์คํ ๊ทธ๋จ๊ณผ KDE ๊ณก์
|
|
|
|
| 117 |
# ํ๊ท ์
|
| 118 |
ax.axvline(mu, color='red', linestyle=':', linewidth=2, alpha=0.8, label=f'ํ๊ท : {mu:.1f}')
|
| 119 |
|
| 120 |
+
# ์ ๋ชฉ๊ณผ ๋ผ๋ฒจ - ํ๊ธ ํฐํธ ์ง์ ์ง์
|
| 121 |
+
ax.set_title(f'{score_column} ์ ์ ๋ถํฌ ๋ถ์', fontproperties=font_prop, fontsize=16, pad=20)
|
| 122 |
+
ax.set_xlabel('์ ์', fontproperties=font_prop, fontsize=12)
|
| 123 |
+
ax.set_ylabel('๋ฐ๋', fontproperties=font_prop, fontsize=12)
|
| 124 |
+
|
| 125 |
+
# ๋ฒ๋ก - ํ๊ธ ํฐํธ ์ ์ฉ
|
| 126 |
+
legend = ax.legend(prop=font_prop, fontsize=10)
|
| 127 |
ax.grid(True, alpha=0.3)
|
| 128 |
|
| 129 |
+
# ํต๊ณ ์ ๋ณด ๋ฐ์ค - ํ๊ธ ํฐํธ ์ ์ฉ
|
| 130 |
stats_text = f'์ํ ์: {len(scores)}\nํ๊ท : {mu:.2f}\nํ์คํธ์ฐจ: {std:.2f}\n์ต์๊ฐ: {scores.min():.1f}\n์ต๋๊ฐ: {scores.max():.1f}'
|
| 131 |
ax.text(0.02, 0.98, stats_text, transform=ax.transAxes,
|
| 132 |
+
fontproperties=font_prop, fontsize=10, verticalalignment='top',
|
| 133 |
bbox=dict(boxstyle='round,pad=0.5', facecolor='lightblue', alpha=0.8))
|
| 134 |
|
| 135 |
plt.tight_layout()
|