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

23 次查看(过去 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
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 CenterFile Exchange 中查找有关 Printing and Saving 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by