<jupyter_start><jupyter_text><jupyter_code>import matplotlib.pyplot as plt
plt.scatter([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5])
plt.title('산점도')
plt.xlabel('변수1')
plt.ylabel('변수2')
plt.grid(True)
plt.show()
!sudo apt install fonts-nanum
!sudo fc-cache -f -v
!rm ~/.cache/matplotlib -rf
import matplotlib 
print(matplotlib.rcParams)<jupyter_output><empty_output><jupyter_text>C:\Windows\Fonts 에 있는 폰트의 세팅하는 이름을 font family에 넣어준다.font.cursive: ['Apple Chancery', 'Textile', 'Zapf Chancery', 'Sand', 'Script MT', 'Felipa', 'cursive']font.family: ['sans-serif']font.fantasy: ['Comic Neue', 'Comic Sans MS', 'Chicago', 'Charcoal', 'Impact', 'Western', 'Humor Sans', 'xkcd', 'fantasy']font.monospace: ['DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Computer Modern Typewriter', 'Andale Mono', 'Nimbus Mono L', 'Courier New', 'Courier', 'Fixed', 'Terminal', 'monospace']font.sans-serif: ['DejaVu Sans', 'Bitstream Vera Sans', 'Computer Modern Sans Serif', 'Lucida Grande', 'Verdana', 'Geneva', 'Lucid', 'Arial', 'Helvetica', 'Avant Garde', 'sans-serif']font.serif: ['DejaVu Serif', 'Bitstream Vera Serif', 'Computer Modern Roman', 'New Century Schoolbook', 'Century Schoolbook L', 'Utopia', 'ITC Bookman', 'Bookman', 'Nimbus Roman No9 L', 'Times New Roman', 'Times', 'Palatino', 'Charter', 'serif']font.size: 10.0font.stretch: normalfont.style: normalfont.variant: normalfont.weight: normal<jupyter_code># font 리스트 가져오기

from matplotlib import font_manager
# 한글 폰트만 뽑아 내기

# font_manager.fontManager.ttflist

for font in font_manager.fontManager.ttflist:
    if 'Nanum' in font.name:
        print(font.name)
from matplotlib import rc
rc('font',family='NanumSquareRound')
import matplotlib.pyplot as plt
plt.scatter([0, 1, 2, 3, 4, 5], [0, 1, 2, 3, 4, 5])
plt.title('산점도')
plt.xlabel('변수1')
plt.ylabel('변수2')
plt.grid(True)
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17653390742734124, 'fraction_numerical': 0.017222820236813777, 'mean_word_length': 6.3478260869565215, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '104470', 'license': 'Apache-2.0', 'n_tokens_mistral': 816, 'n_tokens_neox': 777, 'n_words': 188, 'path': 'Django by Multi/font_settings_matplotlib.ipynb', 'repo_name': 'ginttone/summary', 'size': '1858'}