MATLAB Answers

Why does MATLAB not export EPS files properly?

658 views (last 30 days)
Also, when I generate EPS files from MATLAB, I seem to be getting unusually large files that are displaced to the bottom left hand side of your image, leaving a large white border on two sides. Sometimes the files appear tiled.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 26 Apr 2013
This behavior is most likely due to the renderer.
The renderer that MATLAB is using to display the images is very likely a bitmap renderer such as OpenGL or zbuffer (the figures you sent me used the ‘zbuffer’ renderer). EPS formats are essentially vector formats so it is best if the renderer that you use to generate the figure is also a vector renderer ('painters').
As you are likely using a bitmap renderer, MATLAB has to first convert the bitmap into a vector, and this conversion of bitmaps to vector images is often a time-consuming and inefficient process.
This is why your images appear incorrect when you print them.
SOLUTION:
1) Change the renderer of the figure before you draw your figure or before you export. You can use the following command:
>>set(gcf,'renderer','Painters')
2) Change the renderer used by the PRINT command. By default it uses the same renderer that the figure uses, so you would have to type the following command to over-ride this:
>> print -depsc -tiff -r300 -painters <filename>.eps
or
>> print -depsc2 -tiff -r300 -painters <filename>.eps
Also, I suggest you use a PostScript printer or viewer to view your EPS files. This is just to make sure that you are viewing your actual EPS file and not the TIFF preview.

  6 Comments

Show 3 older comments
Andrew Proppe
Andrew Proppe on 12 Nov 2018
Worked perfeclty for me, thanks! Using R2018b on a macbook
SYED RAFID RAHMAN
SYED RAFID RAHMAN on 13 Mar 2020
Worked perfeclty for me, thanks! Using R2019b on windows.
Iacopo Russo
Iacopo Russo on 6 May 2020
It worked for me, too, using R2020a on an iMac

Sign in to comment.

More Answers (2)

alpha
alpha on 26 May 2017
thanks for the answer, it solved my problem

  0 Comments

Sign in to comment.


Piotr Mazgaj
Piotr Mazgaj on 22 Jul 2019
Edited: Piotr Mazgaj on 26 Jul 2019
hi, in case of two FILLs that overlap, an overlap color is not changed.
And it should as below:

  2 Comments

Narmada Herath
Narmada Herath on 26 Jul 2019
Hello,
If you are facing additional issues, please contact MathWorks Technical Support at:
who may be able to assist further.
-Narmada
Piotr Mazgaj
Piotr Mazgaj on 26 Jul 2019
Thanks, that is a good idea, I have just sent the question to Technical Support.

Sign in to comment.

Tags

No tags entered yet.

Products


Release

R2011b

Community Treasure Hunt

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

Start Hunting!