Why does SAVEAS or PRINT fail to save a figure as it appears on screen in MATLAB?

32 ビュー (過去 30 日間)
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.

採用された回答

MathWorks Support Team
MathWorks Support Team 2013 年 6 月 7 日
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 件)

カテゴリ

Help Center および File ExchangeCreating, Deleting, and Querying Graphics Objects についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by