LoginSignup
5
6

More than 5 years have passed since last update.

PythonのグラフのType3フォント回避

Last updated at Posted at 2018-11-26

PythonのグラフのType3フォント回避

Pythonのmatplotlibによるデフォルトのフォントには, Type3が使われています.
学会などでは, Type3フォントを避けるように指示される場合があります.
以下のようにすることで, Type3フォントを回避できます.
(CID True Typeというフォントになるようです. )

import matplotlib
matplotlib.rcParams['pdf.fonttype'] = 42
matplotlib.rcParams['ps.fonttype'] = 42

また, 以下のようにすることで, Type1フォントにできます.

import matplotlib
matplotlib.rcParams['text.usetex'] = True
matplotlib.rcParams['text.latex.preamble'] = '\usepackage{sfmath}'

参考文献

5
6
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
6