我正在从 matplotlib 导出图表并在 Illustrator 中编辑它们。很高兴我可以编辑线条,但文本也以线条形式出现,所以我无法更改字体、编辑文本等。我导出为 EPS、PDF 和 PS 时遇到了同样的问题。
我在 OSX Snow Leaopard 上使用 matplotlib 版本 1.0.1 和 python 2.7.1。
我很感激您提供的任何见解!我尝试按照建议使用 pdf2ps here ,但所做的只是降低了图像的质量,而没有使文本呈现为真实文本。 pdftops 看起来更好,但仍然无法编辑文本结果。
最佳答案
如果将 pdf.fonttype
设置为 42 (TrueType),则可以在 Acrobat/Illustrator 中编辑文本,并以 pdf 格式导出。您可以在 ~/matplotlib/matplotlibrc
中设置:
pdf.fonttype : 42 # Output Type 3 (Type3) or Type 42 (TrueType)
..或动态:
>>> import matplotlib as mpl
>>> mpl.rcParams['pdf.fonttype'] = 42
显然它默认为 Acrobat/Illustrator 无法处理的 Type3。
关于python - 无法编辑由 Matplotlib 导出并在 Illustrator 中打开的图表中的文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5956182/