2

In Matlab, I am using LaTex interpreter as default and CMU Serif as in Latex as my default font through the following commands inside startup.m.

set(0,'DefaultTextFontname', 'CMU Serif');
set(0,'DefaultAxesFontName', 'CMU Serif');
set(0,'defaulttextinterpreter','latex');

The plot produced from Matlab appears like this, with the fonts in place:

enter image description here

However, upon saving the above image as eps using either print or saveas command produces figure with all the ticks and label in a different font: enter image description here

Can someone suggest, what is the issue resulting in different fonts?

SKPS
  • 5,433
  • 5
  • 29
  • 63
  • 1
    The [question I asked back in 2013](http://stackoverflow.com/questions/16846941/is-it-possible-to-get-around-matlabs-limitation-on-font-embedding-in-vector-for) is still somehow relevant in 2016... – craigim Dec 05 '16 at 18:46
  • Any workaround for this? I already tried `Matlab2tikz` for couple of different plots and it works well. However, I had to abandon it as there continuously were minor issues arising during formatting. – SKPS Dec 05 '16 at 18:55
  • Also tried `psfrag` in combination with `matlabfrag` and could not succeed as I use `pdflatex` instead of `LaTex`. I also tried the top answer in this link: http://tex.stackexchange.com/questions/11839/using-psfrag-with-pdflatex – SKPS Dec 05 '16 at 18:58
  • It has been a few years since I was in a job where I was using LaTeX, so I don't know of a good workaround. I think that eventually I switched to outputting pdfs, which did a much better job of preserving fonts. If I needed the eps version, I would open it in Adobe Illustrator (my organization had a site license) and then save back out as eps. In my 2013 question, someone eventually posted an answer of how to do that very thing using ghostscript. YMMV. – craigim Dec 05 '16 at 21:28

0 Answers0