File Exchange

image thumbnail


version (2.02 KB) by Jose Aumentado
This works around MATLABs tendency to call all fonts 'Helvetica' in .eps files.


Updated 22 Apr 2005

View License

When you export a figure to .eps in MATLAB, it will only use a small number of allowed fonts, even if the user has changed these fonts to something specific to their system. In most cases, you'll end up with 'Helvetica' specified in the resulting eps file. That is, if you import this file into Illustrator and have no font exactly called 'Helvetica' then you will end up substituting something else for it, often times doing bizarre things to your kerning, etc. like moving your subscripts to Siberia.

This script writes the .eps as usual, but figures out what font you actually used in the figure and does a find and replace to place your font (presumably actually resident on your system) back into the file. Currently this does not discriminate between the axis font and other text fonts in the figure (i.e., the title and added text), so everything gets changed to the axis font.

This is just a workaround until Mathworks decides their .eps exporting is problematic.

Cite As

Jose Aumentado (2021). printeps (, MATLAB Central File Exchange. Retrieved .

Comments and Ratings (18)


Hugo Dijkers

Works good.

Run into two bugs:

- font names with a space (Minion Pro) do not convert properly, and the eps cannot be opened with Illustrator.

- Title of plot is not centered anymore after replacing of fonts, can this be fixed?

Any way good Job, and Matlab should fix this long-time issue


Works well. I would repeat the comment of Nick Gravish below, with regards to exact font name. I wanted all text in my exported EPS to be Arial, and I had to make actualfont = 'ArialMT'; for this to work. Setting actualfont = 'Arial' made the EPS have courier fonts.

Another comment, printeps can be called on an EPS figure made by export_fig, which for me is the perfect way to create vector figures from MATLAB.

Top job Jose!


Very nice an easy to use.

I found one weird bug that is not important I guess. The text field of the y-label is sometimes split into two text fields. Here the example code:
ylabel('amplitude [µV]', 'FontSize', 11);
xlabel('test label [µV]');
set(0, 'DefaultAxesFontName', 'Arial');
printeps(fig, 'test.eps');

if you change the ylabel to the following everything is ok:
ylabel('amplitude [µV] ', 'FontSize', 11);

using Matlab 2012b on Windows 7.

Thanks for the tool!


I have the problem that when I look at the eps version of a plot produced with printeps, the text in the title and in the legend get cut off. Does anyone have a good idea of how to fix that? Thanks!


Terrance Nearey

Thanks Jose for saving me some time finding out what Matlab should make clear in documentation. (Wish I'd spotted your contribution a couple of days ago!). The fonts actually supported in PRINT or SAVEAS in espc2 formats is apparently version- and platform-dependent.
On MATLAB Mac OS X Version: 10.6.7 Build: 10J869, the only fonts I could find that wound up in eps files were these: 'Courier' 'Helvetica' 'Palatino' 'Symbol' 'Times' 'Times New Roman' 'Zapf Dingbats'

Both Times New Roman and Times showed up as 'Times-Roman' in the eps file, but at least they weren't changed to 'Helvetica'.



I work with eps figures in adobe illustrator and it has been a continual pain reconfiguring the fonts from matlab exported eps files. Thanks for the function.

One comment for illustrator users. Adobe illustrator (at least on my system) uses the times new roman font TimesNewRomanPSMT, so embedding the actual font name "Times New Roman" returned from get(gca,'FontName') still gives an error in illustrator. My workaround was to hard code actualfont = 'TimesNewRomanPSMT' since I always work with times. Just a heads up for anyone in a similar position.

Andrey Kan

Ted S

Thank you, I assumed this is how MATLAB should have worked, and I was confused why I was having problems.... Works great with this.


works like a charm

Ken Campbell

Simple, but it works. Thanks for solving this annoying problem.

Dario Redaelli

I have exeprienced continuous problems to introduce matlab .eps files in latex ducments! You provided a simple solution, and exactly what I was looking for! Thank you very much.

L Matthews

Thank you,this has been driving me nuts. Why cant They sort real issues like this out.

Maxim Ts

Thanks. It solves the problem!

Hannah S

I haven't checked it thoroughly, but it solved my problem - thanks!

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!