Home > vbmeg > functions > plotfunc > vb_epsfig.m

vb_epsfig

PURPOSE ^

Set Paper position for EPS-File

SYNOPSIS ^

function h=vb_epsfig(fig,rxy,PW)

DESCRIPTION ^

 Set Paper position for EPS-File

 rxy = H/W (Hight/Width raio for output)
 PW  = Paper width in centimeters

 Copyright (C) 2011, ATR All Rights Reserved.
 License : New BSD License(see VBMEG_LICENSE.txt)

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function h=vb_epsfig(fig,rxy,PW)
0002 % Set Paper position for EPS-File
0003 %
0004 % rxy = H/W (Hight/Width raio for output)
0005 % PW  = Paper width in centimeters
0006 %
0007 % Copyright (C) 2011, ATR All Rights Reserved.
0008 % License : New BSD License(see VBMEG_LICENSE.txt)
0009 
0010 if nargin<1,fig=figure;end
0011 if nargin<2,rxy=1;end;
0012 if nargin<3,PW=20;end;
0013 
0014 % Paper Position in centimeters
0015 
0016 PH=rxy*PW;
0017 PL=0.8;
0018 PB=0.5;
0019 
0020 Ppos=[PL PB PW PH];
0021 
0022 % r=(Figure Hight)/(Screen Hight)
0023 
0024 r=0.7;
0025 
0026 Wmargin=50;
0027 Hmargin=130;
0028 
0029 Scr=get(0,'ScreenSize');
0030 W=Scr(3);
0031 H=Scr(4);
0032 
0033 SHW=H/W;
0034 
0035 if rxy >= SHW,
0036     FH=H*r;
0037     FW=FH/rxy;
0038 else
0039     FW=W*r;
0040     FH=FW*rxy;
0041 end;
0042 
0043 FL=W-FW-Wmargin;
0044 FB=H-FH-Hmargin;
0045 
0046 Fpos=[FL FB FW FH];
0047 
0048 set(fig,...
0049   'PaperUnits','centimeters',...
0050   'Position', Fpos,...
0051   'PaperOrientation','portrait',...
0052   'PaperPosition',Ppos);
0053 
0054 
0055 %  'PaperType','a4letter',...
0056 %  'NumberTitle', 'off',...
0057 %  'PaperPosition',[2.2 1.0 27 20]);
0058 
0059 h=fig;
0060 
0061 %

Generated on Mon 22-May-2023 06:53:56 by m2html © 2005