问题描述
我正在从matplotlib中导出图表,并在Illustrator中对其进行编辑.我可以编辑线条很棒,但是文本也以线条形式出现,所以我不能更改字体,编辑文本等.我已经导出为EPS,PDF和PS,但存在相同的问题.
I am exporting charts from matplotlib and editing them in Illustrator. It's great that I can edit the lines, but the text also comes in as lines, so I cannot change fonts, edit text, etc. I've exported as EPS, PDF, and PS with the same issues.
我正在OSX Snow Leaopard上使用带有Python 2.7.1的matplotlib版本1.0.1.
I'm using matplotlib version 1.0.1 with python 2.7.1 on OSX Snow Leaopard.
我感谢您提供的任何见解!我尝试按照建议此处 a>,但所做的一切只是降低了图像质量,而没有使文本呈现为真实文本. pdftops看起来更好,但仍然无法编辑文本结果.
I appreciate any insights offered! I tried using pdf2ps as suggested here, but all that did was degrade the quality of the image without making the text rendered as real text. pdftops looked nicer, but still can't edit the text results.
推荐答案
如果将pdf.fonttype
设置为42(TrueType),则可以在Acrobat/Illustrator中编辑文本,并以pdf格式导出.您可以在~/matplotlib/matplotlibrc
:
You can edit the text in Acrobat/Illustrator if you set pdf.fonttype
to 42 (TrueType), and export in pdf. You can set this in your ~/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.
Apparently it defaults to Type3 which Acrobat/Illustrator can't deal with.
这篇关于无法编辑由Matplotlib导出并在Illustrator中打开的图表中的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!