カメラ対応の提出物の一部として Matplotlib グラフを使用しようとしていますが、出版社は Type 1 フォントのみの使用を要求しています。
PDF バックエンドは、Y 軸が線形の単純なグラフには Type-1 フォントを出力しますが、対数 Y 軸には Type-3 フォントを出力します。
対数 yscale を使用すると、おそらく指数表記がデフォルトで使用されているため、Type 3 フォントを使用しているように見える数学テキストが使用されます。私はこれを回避するために醜いハックを使用することができます. 10、100、1K などのように適合します。
以下の例を、今日の matplotlib マスター ブランチと、同じ動作を生成する 1.1.1 でテストしたので、これがバグであり、おそらく予期しない動作であるとはわかりません。
#!/usr/bin/env python
# Simple program to test for type 1 fonts.
# Generate a line graph w/linear and log Y axes.
from matplotlib import rc, rcParams
rc('font',**{'family':'sans-serif','sans-serif':['Helvetica']})
#rc('font',**{'family':'sans-serif','sans-serif':['computer modern sans serif']})
# These lines are needed to get type-1 results:
# http://nerdjusttyped.blogspot.com/2010/07/type-1-fonts-and-matplotlib-figures.html
rcParams['ps.useafm'] = True
rcParams['pdf.use14corefonts'] = True
rcParams['text.usetex'] = False
import matplotlib.pyplot as plt
YSCALES = ['linear', 'log']
def plot(filename, yscale):
plt.figure(1)
xvals = range(1, 2)
yvals = xvals
plt.plot(xvals, yvals)
plt.yscale(yscale)
plt.savefig(filename + '.pdf')
if __name__ == '__main__':
for yscale in YSCALES:
plot('linegraph-' + yscale, yscale)
対数軸で Type 1 フォントを取得するクリーンな方法を知っている人はいますか?
ありがとう!