admin に投稿
Cross platform

【Windows】

フォント インストール


Google Fonts
jp」で検索。Noto Serif Japanese

Image
anaconda

 

Image
anaconda

 

Image
anaconda
Image
anaconda

展開すると

Image
anaconda

各々を開くと「static」フォルダがある。
開くとフォントファイルを一覧できる。

Image
anaconda

全部選んで右クリック。インストール。

Noto_Serif_JPも同様の操作を行う。

ホームディレクトリにフォルダ「.matplotlib」を作る。
・anaconda
anaconda3/Lib/site-packages/matplotlib/mpl-data/matplotlibrc」を「.matplotlib」内にコピー。

・miniconda
「miniconda3/Lib/site-packages/matplotlib/mpl-data/matplotlibrc」を「.matplotlib」内にコピー。

matplotlibrc

## ***************************************************************************
## * FONT                                                                    *       
## ***************************************************************************
<省略>
font.serif : Noto Serif JP
font.sans-serif : Noto Sans JP
## ***************************************************************************
## * TEXT                                                                    *
## ***************************************************************************

 

【Linux】

フォント インストール

$ sudo apt install fonts-noto-cjk

 

「anaconda3/lib/python3.13/site-packages/matplotlib/mpl-data//matplotlibrc」を「.config/matplotlib」内にコピー。

matplotlibrc
                                        

## ***************************************************************************
## * FONT                                                                    *
## ***************************************************************************
(省略)
font.family: "Noto Serif CJK JP"
## ***************************************************************************
## * TEXT                                                                    *
## ***************************************************************************

 

Visual Studio Code

テスト

import matplotlib.pyplot as plt

plt.title("今日はいい天気!")
plt.show()

 

Image
cuda