JUNGU commited on
Commit
e18d4ac
·
1 Parent(s): 5d64f37

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -6
app.py CHANGED
@@ -6,11 +6,8 @@ import matplotlib.font_manager as fm
6
  from sklearn.cluster import KMeans
7
  import matplotlib.font_manager as fm
8
 
9
- # Set the font to the provided NanumGothic dynamically
10
  font_path = '/home/user/app/NanumGothic-Regular.ttf'
11
- plt.rcParams['font.family'] = 'NanumGothic'
12
- plt.rcParams['font.path'] = font_path
13
- plt.rcParams['axes.unicode_minus'] = False # for minus sign
14
 
15
 
16
  # Data Generation
@@ -73,8 +70,8 @@ def main():
73
  ax.scatter(centroids[:, 0], centroids[:, 1], s=200, c='red', marker='X')
74
  ax.set_xlim(0, 100)
75
  ax.set_ylim(0, 100)
76
- ax.set_title(f"K-means 클러스터링 결과 (k={k_value})")
77
- ax.legend()
78
  st.pyplot(fig)
79
 
80
  if __name__ == "__main__":
 
6
  from sklearn.cluster import KMeans
7
  import matplotlib.font_manager as fm
8
 
 
9
  font_path = '/home/user/app/NanumGothic-Regular.ttf'
10
+ fontprop = fm.FontProperties(fname=font_path, size=12)
 
 
11
 
12
 
13
  # Data Generation
 
70
  ax.scatter(centroids[:, 0], centroids[:, 1], s=200, c='red', marker='X')
71
  ax.set_xlim(0, 100)
72
  ax.set_ylim(0, 100)
73
+ ax.set_title(f"K-means 클러스터링 결과 (k={k_value})", fontproperties=fontprop)
74
+ ax.legend(prop=fontprop)
75
  st.pyplot(fig)
76
 
77
  if __name__ == "__main__":