Script plot_print2.m
Download Script plot_print2.m
set(gcf,'units','centimeters')
set(gca,'units','centimeters')

set(gca,'position',[0 0 1 1])
p=get(gca,'position');
t=get(gca,'tightInset');
w=[p(1)+4.5,p(2)+4,p(3)+4,p(4)+4]
set(gca,'position',w)
x=-pi:.1:pi;y=sin(x);plot(x,y);axis tight;
%

set(gcf,'PaperUnits','centimeters')
set(gcf,'PaperPositionMode','manual')
paper=get(gcf,'PaperPosition')
ratio=paper(3)/paper(4);

a=[paper(1)+6,paper(2)+12,paper(3)-4,paper(4)]
set(gcf,'PaperPosition',a)

printpreview(gcf)
Back