python:matplotlib:フォントの設定
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
python:matplotlib:フォントの設定 [2018/01/21 22:41] – [フォントサイズの設定] koudai | python:matplotlib:フォントの設定 [2021/06/27 22:04] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 34: | Line 34: | ||
なお、グラフに含まれる文字はサンセリフ体が推奨されます(matplotlibのデフォルトはサンセリフ体のDejaVu Sansになっています)。 | なお、グラフに含まれる文字はサンセリフ体が推奨されます(matplotlibのデフォルトはサンセリフ体のDejaVu Sansになっています)。 | ||
- | matplotlibで使用可能なフォント一覧は次のように調べることができます。 | + | matplotlibではotf形式またはttf形式のフォントが利用できます。 |
+ | 使用可能なフォント一覧は次のように調べることができます。 | ||
< | < | ||
$ python | $ python | ||
Line 41: | Line 42: | ||
>>> | >>> | ||
>>> | >>> | ||
+ | </ | ||
+ | エラーが出る場合 | ||
+ | < | ||
+ | >>> | ||
+ | >>> | ||
</ | </ | ||
+ | ttc形式のフォントは使用できないそうです。 | ||
+ | * [[https:// | ||
以下ではもう少し細かい設定を紹介します。 | 以下ではもう少し細かい設定を紹介します。 | ||
Line 67: | Line 75: | ||
plt.legend(fontsize = 20) | plt.legend(fontsize = 20) | ||
- | plt.tick_params(labelsize = 20) # メモリのフォントサイズを設定 | + | plt.tick_params(labelsize = 20) # メモリの数字のフォントサイズを設定 |
plt.tight_layout() | plt.tight_layout() | ||
- | plt.savefig(" | + | plt.show() |
</ | </ |
python/matplotlib/フォントの設定.1516542097.txt.gz · Last modified: 2021/06/27 21:59 (external edit)