通常默认情况下,print命令输出图像为 8*5inches,无视屏幕显示尺寸
通过命令行修改的话有三步
1 设置paperposition为manual
set(gcf,'PaperPositionMode', 'manual')
[ auto | {manual} ]
2
设置paperunit set(gcf,'PaperUnits','inches')
[ {inches} | centimeters | normalized | points ]
3 设置paperposition
set(gcf,'PaperPosition',[left,bottom,width,height])
例如
set(gcf, 'PaperPositionMode', 'manual');
set(gcf, 'PaperUnits', 'points');
set(gcf, 'PaperPosition', [0 0 640 480]);
还有一个相关命令是papersize
paperposition
是placement,代表图像在paper中的所处位置。left和bottom计算好,就可以使图像在paper中居中
papersize是纸张大小;position要比size小的
Factory Default PaperPosition
The
factory defaultPaperPosition,
[0.25 2.5 8.0 6.0]
is
designed to print the figure on 8.5-by-11 inch paper in portrait
orientation. It results in a printed figure that is about as large
as can fit on the paper (with a one-quarter inch border on the left
and right sides) and is centered on the paper. The width of eight
inches and the height of six inches give an aspect ratio (ratio
ofwidthtoheight)
that is the same as the default figure aspect ratio on the
screen.