Clear Filters
Clear Filters

Why is my EPS file generated from a FIG file distorted on my Mac?

2 views (last 30 days)
When I save my FIG file as an EPS file, it becomes distorted. For example, rectangles that are drawn on the image are moved to a new position on the image.
I am using MATLAB R2018a on a Mac.
Why is the EPS file saved incorrectly?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 1 Jun 2018
The EPS file that is generated looks different because the output size (the figure's PaperPosition width & height) differs from the onscreen / original figure's width and height. Because of this, in order for MATLAB to produce output at the specified output size, the figure has to be resized, which causes the rectangle/box that highlights a section of the plot to shift its position.
There are two ways you can adjust the figure's size programmatically to avoid this issue:
1) Before saving the figure as an EPS file, execute the following lines:
>> fig = gcf;
>> fig.PaperPositionMode = 'auto';
this will set the PaperPosition width and height to be the same as the figure's width and height.
2) Before saving the figure as an EPS file, execute the following lines:
>> fig = gcf;
>> fig.Units = fig.PaperUnits;
>> fig.PaperPosition(3:4) = fig.Position(3:4);
this will manually set the width and height (along with the units) to be the same.

More Answers (0)

Categories

Find more on Printing and Saving in Help Center and File Exchange

Products


Release

R2017a

Community Treasure Hunt

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

Start Hunting!