2 Meiryo fontのセットアップ
Linux環境でのMeiryo Font設定
Linux OSの場合,.local/share/fonts
以下に以下のMeiryoフォントをインストールします.
Fonts | File | Explanation |
---|---|---|
Meiryo | meiryo.ttc |
Meiryo UI Regular, Meiryo UI Italic, Meiryo Regular, Meiryo Italic |
meiryob.ttc |
Meiryo UI Bold, Meiryo UI Bold Italic, Meiryo Bold, Meiryo Bold Italic |
環境要件
- Linux operating system(Ubuntuを含む)
fc-cache
コマンド- MacOsで実行する場合は,
brew install ricty
を実行することでfc-cache
コマンドが利用可能になります
- MacOsで実行する場合は,
手順
# download repository
git clone https://github.com/yourusername/ManualFontInstaller.git
cd ManualFontInstaller
# Run script
./install_fonts.sh
Meiryoフォントを用いた可視化
Plotly
import plotly.express as px
= px.scatter(x=[1, 2, 3], y=[4, 5, 6], title="サンプルグラフ")
fig
# X軸ラベルの追加
fig.update_layout(="時間(秒)", # ← ここがX軸ラベル
xaxis_title=dict(family="Meiryo")
font
)
fig.show()
Matplotlib
import matplotlib.pyplot as plt
"font.family"] = "Meiryo"
plt.rcParams[
= [1, 2, 3]
x = [4, 5, 6]
y
="o")
plt.plot(x, y, marker"サンプルグラフ")
plt.title("時間(秒)") # ← ここがX軸ラベル
plt.xlabel("値")
plt.ylabel(
plt.show()