注解
Click here 下载完整的示例代码
usetex字体效果¶
这个脚本演示了pdftex.map文件现在在usetex模式下支持。
import matplotlib.pyplot as plt
def setfont(font):
return rf'\font\a {font} at 14pt\a '
fig = plt.figure()
for y, font, text in zip(range(5),
['ptmr8r', 'ptmri8r', 'ptmro8r',
'ptmr8rn', 'ptmrr8re'],
['Nimbus Roman No9 L ' + x for x in
['', 'Italics (real italics for comparison)',
'(slanted)', '(condensed)', '(extended)']]):
fig.text(.1, 1 - (y + 1) / 6, setfont(font) + text, usetex=True)
fig.suptitle('Usetex font effects')
# Would also work if saving to pdf.
plt.show()
关键词:matplotlib代码示例,codex,python plot,pyplot Gallery generated by Sphinx-Gallery