User Tools

Site Tools


python:matplotlib:フォントの設定

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
python:matplotlib:フォントの設定 [2018/01/22 13:39]
koudai [フォントサイズの設定]
python:matplotlib:フォントの設定 [2021/06/27 22:04] (current)
Line 34: Line 34:
 なお、グラフに含まれる文字はサンセリフ体が推奨されます(matplotlibのデフォルトはサンセリフ体のDejaVu Sansになっています)。 なお、グラフに含まれる文字はサンセリフ体が推奨されます(matplotlibのデフォルトはサンセリフ体のDejaVu Sansになっています)。
  
-matplotlibで使用可能なフォント一覧は次のように調べることができます。+matplotlibではotf形式またはttf形式のフォントが利用できます。 
 +使用可能なフォント一覧は次のように調べることができます。
 <code> <code>
 $ python $ python
Line 41: Line 42:
 >>> names = [matplotlib.font_manager.FontProperties(fname=fname).get_name() for fname in flist] >>> names = [matplotlib.font_manager.FontProperties(fname=fname).get_name() for fname in flist]
 >>> print(names) >>> print(names)
 +</code>
 +エラーが出る場合
 +<code>
 +>>> import matplotlib.font_manager
 +>>> matplotlib.font_manager.get_fontconfig_fonts()  # あるいは matplotlib.font_manager.findSystemFonts()
 </code> </code>
  
 +ttc形式のフォントは使用できないそうです。
 +  * [[https://qiita.com/yniji/items/3fac25c2ffa316990d0c]]
  
 以下ではもう少し細かい設定を紹介します。 以下ではもう少し細かい設定を紹介します。
python/matplotlib/フォントの設定.1516595997.txt.gz · Last modified: 2021/06/27 21:59 (external edit)