python - 无法编辑由 Matplotlib 导出并在 Illustrator 中打开的图表中的文本

标签 python pdf matplotlib adobe-illustrator eps

我正在从 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/

相关文章:

python-3.x - 如何在 Numpy/MatplotLib 中可视化线性规划(具有任意不等式)的可行区域?

python - Numpy 多维数组中的索引顺序

python - 使用python将十六进制转为字符串

php:逆转 mysql_real_escape_string 对二进制文件的影响

macos - 从 Cocoa 将 View 导出为 PDF

python - 当 x 轴不等距时,Matplotlib 不会连接数据点

python - 填补 MultiIndex Pandas Dataframe 中的日期空白

Python 随机存取文件

c# - 无法使用 .Net 和 True View (AcCtrl) 将 .dwg 转换为 .pdf

python - 如何使用任意数据使用 matplotlib 制作 4d 图