如何全屏保存MATLAB图形

How to save MATLAB figure in full screen

我想在 FULL SCREEN 中保存图表。

我的代码将图形保存在 tiff 文件中,但不是全屏;带有重叠的 txt 标题。 拜托,有人知道如何解决这个问题吗?

scrsz = get(0,'ScreenSize');
set(figure,'position',scrsz);

subplot(2,2,1)

surf(peaks(30))
title(' **********************      test        ************************** '); 

subplot(2,2,2)
surf(peaks(30))
title(' **********************      test        ************************** ');

subplot(2,2,3)
surf(peaks(30))
title(' **********************      test        ************************** '); 

subplot(2,2,4)
surf(peaks(30))
title(' **********************       test       ************************** '); 

saveas(gcf,'test.tiff')

答案:

set(gcf,'PaperPositionMode','auto','PaperPosition',[0 0 20 10])
print -dtiff -r96 itest.tiff  

您应该更改纸上的尺寸 space 并使用 "Print" 而不是 "Save as". 例如:

set (gcf, 'PaperPositionMode', 'manual','PaperPosition',[0 0 30 20])
print -dtif -r 150 test.tiff

这将创建分辨率为 150dpi 的 tiff 30x20 厘米。 玩转尺寸,您可以轻松获得所需尺寸的数字。

属性 "position" 与 .fig 个文件相关,并定义该文件在屏幕上的位置 space。打印后(将 Matlab 图形保存为图片 jpegpngtiffpdf)尺寸应在论文中定义 space.

希望对您有所帮助。