在纸上以精确尺寸打印MATLAB图

Roo*_*ook 16 printing matlab plot

我有一个需要在纸上打印出精确尺寸的图,因为它是按比例绘制的,而且在纸上它会测量一些东西.什么是最简单的(有可能)这样做的方式?

Amr*_*mro 24

编辑:

%# create some plot, and make axis fill entire figure
plot([0 5 0 5], [0 10 10 0]), axis tight
set(gca, 'Position',[0 0 1 1])

%# set size of figure's "drawing" area on screen
set(gcf, 'Units','centimeters', 'Position',[0 0 5 10])

%# set size on printed paper
%#set(gcf, 'PaperUnits','centimeters', 'PaperPosition',[0 0 5 10])
%# WYSIWYG mode: you need to adjust your screen's DPI (*)
set(gcf, 'PaperPositionMode','auto')

%# save as TIFF
print -dtiff -r0 out.tiff
Run Code Online (Sandbox Code Playgroud)

(*):http://www.mathworks.com/help/matlab/creating_plots/printing-images.html

截图

  • @Rook:您还可以使用PaperPositionMode = auto尝试其他方法(自定义显示器的DPI设置后)吗?还要确保使用TIFF图像作为输出(出于某种原因,EPS/PDF似乎有点大) (2认同)
  • @Amro - 这种方法可以在纸上完成5x10厘米.感谢Amro的所有帮助.这对我来说非常重要.与手动配置所有这些打印参数相比,它将节省大量时间. (2认同)