MATLAB: How to make MATLAB print in WYSIWYG mode

figureMATLABpaperpositionmodeprintingscalingsize;windowwysiwyg

Many times when using OpenGL to render my figures, the resolution is not as good as it is on the screen. When using the Painters algorithm, objects shift position.

Best Answer

There are several ways to ensure that your objects maintain a consistent look when printing. With MATLAB you can do the following:
1) Set the PaperPositionMode of the figure to 'auto'. The following command forces the figure's size and location on the printed page to directly reflect the figure's size on the screen:
 
set(gcf,'PaperPositionMode','auto')
2) Set the figure's screen position to the same dimensions as the figure's PaperPosition.
 
ppos = get(gcf,'PaperPosition');
su = get(gcf,'Units');
pu = get(gcf,'PaperUnits');
set(gcf,'Units',pu);
spos = get(gcf,'Position');
set(gcf,'Position',[spos(1) spos(2) ppos(3) ppos(4)])
set(gcf,'Units',su)