matplotlib์ด ๊ธฐ๋ณธ์ ์ผ๋ก ๊ฐ์ง ํฐํธ๋ ํ๊ธ์ ์ง์ํ์ง ์๋๋ค.
๋ฐ๋ผ์ ๊ทธ๋ํ์ ํ๊ธ์ด ํฌํจ๋๋ค๋ฉด ํ์์ ์ผ๋ก ํฐํธ๋ฅผ ๋ณ๊ฒฝํด์ค ํ์๊ฐ ์๋ค.
์ฌ๋ฌ๊ณณ์์ ์น์ํ์ ํ ๊ฒฐ๊ณผ, ๋์ธ๊ฐ์ง ์ ๋์ ๋ฐฉ๋ฒ์ด ์์์ผ๋ ๋ญ๊ฐ ๊ท์ฐฎ์๊ณ ,
์ฝ๋์์์ ์ด์์ฒด์ ์ ๋ฐ๋ผ ํฐํธ๋ฅผ ๋ณ๊ฒฝํ๊ณ ์ํ๋ค.
<ํ๊ธ ํฐํธ ์ ํ๊ธฐ ์ >
<ํ๊ธ ํฐํธ ์ ์ฉํ๊ธฐ>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import platform
from matplotlib import font_manager, rc
import matplotlib.pyplot as plt
##๊ทธ๋ํ์ ๊ฒฐ๊ณผ๋ฅผ ์ถ๋ ฅ ์ธ์
์ ๋ํ๋๊ฒ ํ์
%matplotlib inline
plt.rcParams['axes.unicode_minus'] = False
if platform.system() == 'Darwin':
rc('font', family = 'AppleGothic')
elif platform.system() == 'Windows':
path ='C:/Windows/Fonts/malgun.ttf'
font_name = font_manager.FontProperties(fname=path).get_name()
rc('font', family=font_name)
else:
print("Can't find your system.")
|
cs |
<ํ๊ธ ํฐํธ ์ ์ฉํ>
์ ์ญ์ผ๋ก ์ ์ธํ๋ ๋ฐฉ๋ฒ, rc ํ์ผ์ ์์ ํด์ํ๋ ๋ฐฉ๋ฒ๋ ์์ง๋ง
์๋ํ๋ ๋ฐฉ๋ฒ์ค ์ ์ผ ๊ฐ๋จํ๊ฒ ํ๊ธ๋ก ๋ณ๊ฒฝํ ์ ์์๋ค.
์ถ์ฒ : [์ฑ ] ํ์ด์ฌ์ผ๋ก ๋ฐ์ดํฐ ์ฃผ๋ฌด๋ฅด๊ธฐ, ๋ฏผํ๊ธฐ
๋๊ธ