Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot edit text in chart exported by Matplotlib and opened in Illustrator

Tags:

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.

I'm using matplotlib version 1.0.1 with python 2.7.1 on OSX Snow Leaopard.

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.

like image 572
mishaF Avatar asked May 10 '11 20:05

mishaF


People also ask

How do I edit a pre existing text in Illustrator?

Step 1: Select the text using the Selection Tool (V) if you need to edit all text in one style. Starting from scratch? select the Type Tool (T) to add text. Another way is to select the Type Tool or double click on the text, it'll automatically switch to the Type Tool, so you can select the text area you want to edit.


1 Answers

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)

..or dynamically:

>>> import matplotlib as mpl
>>> mpl.rcParams['pdf.fonttype'] = 42

Apparently it defaults to Type3 which Acrobat/Illustrator can't deal with.

like image 159
zeekay Avatar answered Sep 18 '22 18:09

zeekay