Issue #
Matplotlib default font does not have Korean characters so Korean text outputs as blocks when plotting figures.
import matplotlib.pyplot as plt
x= {"사과": 100, "귤": 80, "호박": 60, "수박": 40}
plt.bar(x.keys(), x.values())
# output: UserWarning: Glyph 49324 (\N{HANGUL SYLLABLE SA}) missing from font(s) DejaVu Sans. func(*args, **kwargs)...
Fix #
Change the font used by Matplotlib.
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'AppleGothic' # for mac. For Windows, use 'Malgun Gothic'
plt.rcParams['axes.unicode_minus'] = False
x= {"사과": 100, "귤": 80, "호박": 60, "수박": 40}
plt.bar(x.keys(), x.values())