Why does SAVEAS or PRINT fail to save a figure as it appears on screen in MATLAB?
28 views (last 30 days)
Show older comments
When using the figure GUI: File -> Save, it saves the figure as it appears on the screen.
However, when using either SAVEAS or PRINT function, several changes are noted. Among them:
1) It changes Grid color to black in the saved image.
2) Text becomes distorted.
3) My figure is resized such that the proportions and tick labels are changed.
Accepted Answer
MathWorks Support Team
on 7 Jun 2013
The following code resolves the figure resizing issue:
set(fig, 'PaperPositionMode', 'auto')
where 'fig' is your figure handle. You can also just pass 'gcf'. The 'PaperPositionMode' property (as published in documentation) "...ensures that the printed version is the same size as the onscreen version. With 'PaperPositionMode' set to 'auto' MATLAB does not resize the figure to fit the current value of the 'PaperPosition'."
You may also find the following code to change the grid color and figure background color helpful so further manipulate the figure that is being saved.
set(gcf, 'InvertHardCopy', 'off'); % setting 'grid color reset' off
set(gcf, 'Color', [1 1 1]); %setting figure window background color back to white
Please refer to the various properties listed in the figure properties and axes properties documentation for additional saving and printing settings that may affect the look of your figure when exporting to printer or file.
0 Comments
More Answers (0)
See Also
Categories
Find more on Printing and Saving in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!