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

时间:2010-08-30 13:51:20

标签: matlab printing plot

我有一个需要在纸上以精确尺寸打印的图,因为它是按比例的,并且从纸上的一些东西将被测量。什么是最简单的(有可能)这样做吗?

1 个答案:

答案 0 :(得分: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

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

screenshot